Skip to content

Commit 8b6e33d

Browse files
committed
format
1 parent e75c73a commit 8b6e33d

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/Security/MD5.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ private static String[] splitByNumber(String str, int len) {
1313
return (len < 1 || str == null) ? null : str.split("(?<=\\G.{" + len
1414
+ "})");
1515
}
16-
16+
17+
// generate MD5 code
1718
private String getMD5Code(String str) throws NoSuchAlgorithmException {
18-
MessageDigest m = MessageDigest.getInstance("MD5");
19-
m.update(str.getBytes(), 0, str.length());
20-
String rsl = new BigInteger(1, m.digest()).toString(16);
19+
MessageDigest md = MessageDigest.getInstance("MD5");
20+
md.update(str.getBytes());
21+
String rsl = new BigInteger(1, md.digest()).toString(16);
2122
return rsl.length() == 32 ? rsl : "0" + rsl;
2223
}
2324

src/Security/test.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ public static void main(String[] args) throws NoSuchAlgorithmException {
1717
System.out.println("TST: 02a76a9b1977a1899865e32af97471cb");
1818

1919
}
20-
2120
}

0 commit comments

Comments
 (0)