package com.cool.store.utils;

import cn.hutool.core.util.IdUtil;
import org.apache.commons.lang3.StringUtils;

/**
 * 唯一性ID工具类
 *
 * @author Aaron
 * @ClassName UUIDUtils
 * @Description 唯一性ID工具类
 */
public class UUIDUtils {

    /**
     * 简化的UUID，去掉了横线，使用性能更好的ThreadLocalRandom生成UUID
     */
    public static String get32UUID() {
        return IdUtil.fastSimpleUUID();
    }
    public static String get8UUID() {
        return StringUtils.substring(IdUtil.fastSimpleUUID(),1,9);
    }

    public static Long get8LongUuid() {
        long uuid = (int) (Math.random() * 90000000 + 10000000);
        return uuid;
    }

}
