List of utility methods to do Hex Calculate
String | toHexString(final int i) to Hex String return "0x" + Integer.toHexString(i); |
String | toHexString(final int value) Returns a string representation of the integer argument as an unsigned integer in base 16. return "0x" + Integer.toHexString(value).toUpperCase(); |
String | toHexString(final long num, final char paddingChar, int min, int max) Internal use. StringBuffer sb = new StringBuffer(Long.toHexString(num)); if (max < min) { return sb.toString(); while (sb.length() < max) { sb.insert(0, paddingChar); return sb.substring(0, min); ... |
String | toHexString(int b) to Hex String return "" + toHexChar(b >> 4) + toHexChar(b); |
String | toHexString(int b) Returns a hex string representation of a 8 bit integer. char[] digits = new char[2]; b = b & 255; digits[0] = hexDigits[b / 0x10]; digits[1] = hexDigits[b % 0x10]; return new String(digits); |
String | toHexString(int bits, int value) to Hex String if (bits < 32) value &= (1 << bits) - 1; String ret = Integer.toHexString(value); int len = (bits + 3) / 4; while (ret.length() < len) ret = "0" + ret; if (ret.length() > len) ret = ret.substring(ret.length() - len); ... |
String | toHexString(int decimal, int stringLength) Converts a decimal value to a hexadecimal string represention of the specified length. return String.format("%0" + stringLength + "X", decimal); |
String | toHexString(int decimal, int stringLength) Converts a decimal value to a hexadecimal string represention of the specified length. StringBuilder sb = new StringBuilder(stringLength); String hexVal = Integer.toHexString(decimal).toUpperCase(); int nofZeros = stringLength - hexVal.length(); for (int i = 0; i < nofZeros; i++) { sb.append('0'); sb.append(hexVal); return sb.toString(); ... |
String | toHexString(int i) to Hex String final String zeroes = "0000000"; final String s = Integer.toHexString(i).toUpperCase(); if (s.length() < 8) return zeroes.substring(s.length() - 1) + s; else return s; |
String | toHexString(int i) convert an integer to a 2-digit hex string. String s = Integer.toHexString(i); while (s.length() < 2) { s = "0" + s; return s; |