package com.chushang.common.core.util;

import cn.hutool.core.lang.id.NanoId;
import cn.hutool.crypto.digest.MD5;
import com.chushang.common.core.constant.CharConstants;
import lombok.experimental.UtilityClass;
import lombok.extern.slf4j.Slf4j;

import java.math.BigInteger;

/**
 * by zhaowenyuan create 2021/12/29 18:00
 */
@Slf4j
@UtilityClass
public class IdUtils {
    public synchronized String getId(){
        return getId(8);
    }

    public synchronized String getId(int count){
        return getId(count, CharConstants.chars);
    }

    public synchronized String getId(int count, char[] chars){
        return NanoId.randomNanoId(null, chars, count);
    }
}
