IntelligentRecognition/ah-jjsp-service/.svn/pristine/d6/d61bd27d2eeda1683f81888996a...

24 lines
498 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.sercurityControl.proteam.util;
/**
* @author cw chen
* @description TODO
* @date 2023-03-31 14:47
*/
public class IDUtils {
private static byte[] lock = new byte[0];
// 位数默认是8位
private final static long w = 100000000;
public static String createID() {
long r = 0;
synchronized (lock) {
r = (long) ((Math.random() + 1) * w);
}
return System.currentTimeMillis() + String.valueOf(r).substring(1);
}
}