List of utility methods to do XML Hex
String | sha1Hex(String message) sha1 encryption utility. byte[] buffer = message.getBytes(); MessageDigest md = MessageDigest.getInstance("SHA1"); md.update(buffer); byte[] digest = md.digest(); String hash = DatatypeConverter.printHexBinary(digest).toLowerCase(); return hash; |
String | stringToHex(String str) Converts a String to hexadecimal. byte bytes[] = str.getBytes(); return DatatypeConverter.printHexBinary(bytes); |
byte[] | toByteArray(String hex) to Byte Array if (hex.length() % 2 != 0) { hex = "0" + hex; return DatatypeConverter.parseHexBinary(hex); |
byte[] | toByteArray(String hexDumpString) Converts a hex string to byte array return DatatypeConverter.parseHexBinary(hexDumpString.replaceAll(" ", "")); |
byte[] | toByteArrayFromHexString(String s) Returns a byte array from a given hex string. return DatatypeConverter.parseHexBinary(s);
|
byte | toByteFromHexString(String hexString) Returns a byte from a given hex string. byte[] byteArray = DatatypeConverter.parseHexBinary(hexString); return byteArray[0]; |
String | toHex(byte[] bytes) Converts a byte array to a lower case hex representation. if (bytes == null) { return ""; } else { return DatatypeConverter.printHexBinary(bytes).toLowerCase(); |
String | toHex(byte[] bytes) to Hex return DatatypeConverter.printHexBinary(bytes);
|
String | toHex(byte[] donnees) to Hex return javax.xml.bind.DatatypeConverter.printHexBinary(donnees);
|
String | toHex(String str) to Hex return toHex(str.getBytes());
|