I am having a hard time trying to convert a String containing the hexadecimal representation of some bytes to its corresponding byte array.
I am getting 32bytes 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 get from the String to the array? In other words, how to do the reverse of the code above.
Thanks.