MCPcopy Create free account
hub / github.com/0linlin0/CyberBox / md5

Method md5

Skay_Exp/src/tools/CryptLib.java:62–85  ·  view source on GitHub ↗

Note: This function is no longer used. This function generates md5 hash of the input string @param inputString @return md5 hash of the input string

(final String inputString)

Source from the content-addressed store, hash-verified

60 * @return md5 hash of the input string
61 */
62 public static final String md5(final String inputString) {
63 final String MD5 = "MD5";
64 try {
65 // Create MD5 Hash
66 MessageDigest digest = java.security.MessageDigest
67 .getInstance(MD5);
68 digest.update(inputString.getBytes());
69 byte messageDigest[] = digest.digest();
70
71 // Create Hex String
72 StringBuilder hexString = new StringBuilder();
73 for (byte aMessageDigest : messageDigest) {
74 String h = Integer.toHexString(0xFF & aMessageDigest);
75 while (h.length() < 2)
76 h = "0" + h;
77 hexString.append(h);
78 }
79 return hexString.toString();
80
81 } catch (NoSuchAlgorithmException e) {
82 e.printStackTrace();
83 }
84 return "";
85 }
86
87 /**
88 *

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected