24 lines
447 B
Plaintext
24 lines
447 B
Plaintext
package com.bonus.core;
|
|
|
|
import java.util.UUID;
|
|
|
|
public class UUIDHelper {
|
|
|
|
/**
|
|
* 封装JDK自带的UUID, 通过Random数字生成, 中间无-分割.
|
|
*/
|
|
public static String get32UUID() {
|
|
String uuid = UUID.randomUUID().toString().trim().replaceAll("-", "");
|
|
return uuid;
|
|
}
|
|
|
|
/**
|
|
* 封装JDK自带的UUID, 通过Random数字生成, 中间有-分割.
|
|
*/
|
|
public static String uuid() {
|
|
return UUID.randomUUID().toString();
|
|
}
|
|
|
|
}
|
|
|