Skip to content

Commit c143c4f

Browse files
author
yushuwang
committed
feat:permission control for application
1 parent 1ee7c23 commit c143c4f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arex-storage-web-api/src/main/java/com/arextest/storage/utils/RandomUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import java.security.MessageDigest;
66
import java.security.NoSuchAlgorithmException;
7-
import java.util.Random;
7+
import java.security.SecureRandom;
88

99
/**
1010
* @author wildeslam.
@@ -13,12 +13,12 @@
1313
@Slf4j
1414
public class RandomUtils {
1515
private static final int ID_LENGTH = 16;
16-
private static final Random RANDOM = new Random();
16+
private static final SecureRandom RANDOM = new SecureRandom();
1717

1818
public static String generateRandomId(String identifier) {
1919
String sourceString = System.currentTimeMillis() + "-" + RANDOM.nextInt() + "-" + identifier;
2020
try {
21-
MessageDigest md = MessageDigest.getInstance("MD5");
21+
MessageDigest md = MessageDigest.getInstance("SHA-512");
2222
byte[] bytes = md.digest((sourceString).getBytes());
2323
StringBuilder sb = new StringBuilder();
2424
for (byte b : bytes) {

0 commit comments

Comments
 (0)