public static String bytesToHexString(byte[] bytes) {
StringBuffer sb = new StringBuffer();
for (byte b : bytes) {
int val = b & 0xff;
if (val < 0x10) {
sb.append("0");
}
sb.append(Integer.toHexString(val));
}
return sb.toString();
}
Created
December 10, 2015 06:52
-
-
Save yuanliwei/8284e72bcdd7763a1a15 to your computer and use it in GitHub Desktop.
java code : byte[] -> Hex String
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment