Files
timeline-server/timeline-component-common/src/main/java/com/timeline/common/utils/IdUtils.java
jiangh277 eba0eb085e init2
2025-08-04 16:51:13 +08:00

19 lines
507 B
Java
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.timeline.common.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();
}
}