It's hard for me to try to convert a string containing the hexadecimal representation of some bytes into the corresponding byte array.
I get 32 bytes using the following code:
StringBuffer sb = new StringBuffer();
for (int i = 0; i < mdbytes.length; i++) {
sb.append(Integer.toString((mdbytes[i] & 0xff) + 0x100, 16).substring(1));
}
return sb.toString();
Any idea how to go from String to array? In other words, how to do the reverse code above.
Thank.
nunos source
share