init
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package com.timeline.utils;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class IdUtils {
|
||||
public static String randomUuid() {
|
||||
return UUID.randomUUID().toString().replace("-", "");
|
||||
}
|
||||
public static String randomUuid(boolean dash) {
|
||||
return dash ? UUID.randomUUID().toString() : UUID.randomUUID().toString().replace("-", "");
|
||||
}
|
||||
/**
|
||||
* 获取无分隔符的 UUID(大写)
|
||||
*/
|
||||
public static String randomUuidUpper() {
|
||||
return randomUuid().toUpperCase();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user