I am retrieving a base-64 encoded byte array and need to return its string value. Looking over previous posts, I found that this could be done with hex conversion. Am I on the right path?
Thanks for any help.
Pinned topic How to obtain the string value of an encoded byte array
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-11-29T22:38:05Z at 2012-11-29T22:38:05Z by HermannSW
SystemAdmin 110000D4XK6772 Posts
HermannSW 2700006U545034 Posts
Re: How to obtain the string value of an encoded byte array2012-11-29T22:38:05ZThis is the accepted answer. This is the accepted answer.
- SystemAdmin 110000D4XK
your original question was on how to determine the "string value" of a base64 encoded string.
David answered that question.
Your "dp:radix-convert(_, 64, 16)" solution does return the "hexadecimally encoded string".
If that is what you really want, fine.
But be aware that you will loose any leading 0x00 bytes by this (radix-convert is a "number" function).
So if you do not want that, you would need a solution like this:
(it prepends base64('F00000')='8AAA', converts, and then just strips the first 6 prepended characters)
Hermann <myXsltBlog/> <myXsltTweets/>Updated on 2014-03-25T02:45:19Z at 2014-03-25T02:45:19Z by iron-man