List of utility methods to do Hex Calculate
String | toHexString(byte b) toHexString. char[] chars = new char[2]; int d = (b & 0xF0) >> 4; int m = b & 0x0F; chars[0] = hexTable[d]; chars[1] = hexTable[m]; return new String(chars); |
String | toHexString(byte b) Convert a byte into Hex string String s = Integer.toHexString(b); s = s.toUpperCase(); StringBuffer sb = new StringBuffer(); int len = s.length(); if (len == 1) { sb.append("0").append(s); } else if (len == 2) { sb.append(s); ... |
String | toHexString(byte b) to Hex String StringBuffer sb = new StringBuffer("00"); sb.append(Integer.toHexString(b)); return sb.substring(sb.length() - 2); |
String | toHexString(byte b) Returns the string representation of a byte. return toHexString(null, b).toString();
|
String | toHexString(byte b) to Hex String String s = Integer.toHexString(b & 0xFF).toUpperCase(); return (s.length() == 2) ? (s) : ("0" + s); |
String | toHexString(byte b) to Hex String String hex = Integer.toHexString((int) b & 0xff); if (hex.length() == 1) { return ('0' + hex); } else { return hex; |
String | toHexString(byte b) to Hex String StringBuffer result = new StringBuffer(3); result.append(Integer.toString((b & 0xF0) >> 4, 16)); result.append(Integer.toString(b & 0x0F, 16)); return result.toString(); |
String | toHexString(byte b[]) to Hex String StringBuffer hexString = new StringBuffer(); for (int i = 0; i < b.length; i++) { String plainText = Integer.toHexString(0xff & b[i]); if (plainText.length() < 2) plainText = "0" + plainText; hexString.append(plainText); return hexString.toString(); ... |
String | toHexString(byte b[]) convert an array of bytes to an hexadecimal string int pos = 0; char[] c = new char[b.length * 2]; for (int i = 0; i < b.length; i++) { c[pos++] = toHex[(b[i] >> 4) & 0x0F]; c[pos++] = toHex[b[i] & 0x0f]; return new String(c); |
String | toHexString(byte b[]) to Hex String StringBuffer sb = new StringBuffer(); for (int i = 0; i < b.length; i++) { sb.append(HEX_CHARS.charAt(b[i] >>> 4 & 0xf)); sb.append(HEX_CHARS.charAt(b[i] & 0xf)); return sb.toString(); |