package cn.qinys.platform.base.utils;

import java.util.Random;

/**
 * Description:
 *
 * @author tanlie
 * Date: 2024/2/21 17:17
 */
public class RandomUtils {
    /**
     * 返回随机数只包含数字
     *
     * @param length 随机数个数
     * @return
     */
    public static String getNumRandom(int length) {
        StringBuilder val = new StringBuilder();
        Random random = new Random();
        //参数length，表示生成几位随机数
        for (int i = 0; i < length; i++) {
            val.append(random.nextInt(10));
        }
        return val.toString();
    }
}
