L
Laura Schmidt
Hi,
I try to convert a byte array to a hex string like this:
private static String hex_encode (byte [] val)
{
BigInteger b = new BigInteger(val);
String t = b.toString(16);
return (t);
}
For a long byte array it returns a "negative" hex string, i. e. starting
with a "-" sign.
But I want just the bytes in the array converted to hex representation,
each one ranging from "00" to "FF". There should be no minus sign then.
Can you help?
Thanks!
Laura
I try to convert a byte array to a hex string like this:
private static String hex_encode (byte [] val)
{
BigInteger b = new BigInteger(val);
String t = b.toString(16);
return (t);
}
For a long byte array it returns a "negative" hex string, i. e. starting
with a "-" sign.
But I want just the bytes in the array converted to hex representation,
each one ranging from "00" to "FF". There should be no minus sign then.
Can you help?
Thanks!
Laura