Skip to content

Commit f685581

Browse files
committed
add md5EncryptPassword
1 parent 72e9ed3 commit f685581

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>top.mryan2005</groupId>
88
<artifactId>javaplusplus</artifactId>
9-
<version>1.0.2-beta</version>
9+
<version>1.0.3-beta</version>
1010

1111
<developers>
1212
<developer>

src/main/java/top/mryan2005/MD5.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@
55
import java.util.Random;
66

77
public class MD5 {
8+
9+
public static String md5EncryptPassword(String password) {
10+
String res = "";
11+
for(int i = 1; i <= 5; ++i) {
12+
if(i == 1) res = DigestUtils.md5Hex(password);
13+
else res = DigestUtils.md5Hex(res);
14+
}
15+
return res;
16+
}
17+
818
public Hash generateMd5Hash(String input) {
919
Hash hash = new Hash();
1020
hash.hash = DigestUtils.md5Hex(input);

0 commit comments

Comments
 (0)