package cn.wisenergy.common.utils;

import cn.hutool.core.lang.UUID;

import java.io.Serializable;
import java.math.BigInteger;

/**
 * 生成充值卡子卡卡号工具类
 */
public class CardNumberUtil implements Serializable {
    private static final long serialVersionUID = -9056417839913098262L;

    //字符串长度
    static final int LENGTH= 11;

    public static String cardNumber() {
        //添加十一位数字生成卡号
        String uuid = String.format("%040d", new BigInteger(UUID.randomUUID().toString().replace("-", ""), 16));

        return uuid.toString().substring(0,LENGTH);
    }

}
