timeline-server/timeline-component-common/src/main/java/com/timeline/utils/IdUtils.java

19 lines
500 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.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();
}
}