2025-08-04 16:51:13 +08:00
|
|
|
|
package com.timeline.common.utils;
|
2025-07-22 23:00:39 +08:00
|
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|