List of utility methods to do String to Hex
String | convertStringToHex(String str) convert String To Hex char[] chars = str.toCharArray(); StringBuffer hex = new StringBuffer(); for (int i = 0; i < chars.length; i++) { hex.append(Integer.toHexString((int) chars[i])); return hex.toString(); |
String | convertStringToHexComma(String plain, boolean appendNullSigns) convert String To Hex Comma if (plain == null || plain.trim().length() == 0) return plain; StringBuffer strBuf = new StringBuffer(); for (int x = 0; x != plain.length(); x++) { if (x > 0) strBuf.append(","); strBuf.append(Integer.toHexString(plain.charAt(x))); if (appendNullSigns) ... |
String | convertStringtoHexFormat(String stringToConvert) This method converts each character in the string to its hexidecimal format String hexString = ""; for (int index = 0; index < stringToConvert.length(); index++) { int x = stringToConvert.charAt(index); hexString += "\\u" + Integer.toHexString(x); return hexString; |
String | convertStringToHexString(String data) Convert the string to hex string value. return conventBytesToHexString(data.getBytes());
|