List of utility methods to do MD5
String | digestMD5(String text) Calculate the MD5 digest code for the text. return digest(text, "MD5"); |
String | encryptmd5(String str) encryptmd char[] a = str.toCharArray(); for (int i = 0; i < a.length; i++) { a[i] = (char) (a[i] ^ 'l'); String s = new String(a); return s; |
String | generateMD5ByContent(String content) generate MD By Content return ""; |
String | getFileMD5(String filePath) get File MD try { MessageDigest md = MessageDigest.getInstance("MD5"); md.update(Files.readAllBytes(Paths.get(filePath))); byte[] digest = md.digest(); return DatatypeConverter.printHexBinary(digest).toLowerCase(); } catch (Exception e) { e.printStackTrace(); return null; |
String | getHexMd5(byte[] bytes) Get a hex representation of the MD5 checksum of an array of bytes. MessageDigest digest = null; try { digest = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { digest.update(bytes); String md5 = DatatypeConverter.printHexBinary(digest.digest()).toLowerCase(); return md5; ... |
String | getMD5(File file) Get the MD5 Hash from the given File. String path = file.getAbsolutePath(); MessageDigest md = MessageDigest.getInstance("MD5"); md.update(Files.readAllBytes(Paths.get(path))); return DatatypeConverter.printHexBinary(md.digest()).toUpperCase(); |
String | getMD5ByString(String orginalString) get MD By String return orginalString;
|
String | getMD5Checksum(String path) get MD Checksum return null;
|
String | getMd5DigestHex(final String content) get Md Digest Hex MessageDigest md = MessageDigest.getInstance("MD5"); byte[] digest = md.digest(content.getBytes()); return DatatypeConverter.printHexBinary(digest); |
String | getMD5Hex(byte[] digest) get MD Hex StringBuilder result = new StringBuilder(); for (byte b : digest) { String hexString = Integer.toHexString(b & 0xff); if (hexString.length() == 1) { result.append("0"); result.append(hexString); return result.toString(); |