xiangpei
2024-08-29 3e9a6da99aae968123ee7bca352fc08becd7f1f2
ycl-server/src/main/java/com/ycl/utils/uuid/IdUtils.java
@@ -1,15 +1,20 @@
package com.ycl.utils.uuid;
import java.text.SimpleDateFormat;
/**
 * ID生成器工具类
 *
 *
 * @author ruoyi
 */
public class IdUtils
{
    private final static SimpleDateFormat FORMAT = new SimpleDateFormat("yyyyMMddHHmmss");
    /**
     * 获取随机UUID
     *
     *
     * @return 随机UUID
     */
    public static String randomUUID()
@@ -39,11 +44,21 @@
    /**
     * 简化的UUID,去掉了横线,使用性能更好的ThreadLocalRandom生成UUID
     *
     *
     * @return 简化的UUID,去掉了横线
     */
    public static String fastSimpleUUID()
    {
        return UUID.fastUUID().toString(true);
    }
    /**
     * 获取当前时间+随机数的编号
     *
     * @return 编号
     */
    public static String randomNO()
    {
        return UUID.randomUUID().toString().replaceAll("-","").substring(0, 24);
    }
}