package com.mmc.iuav.general;

import java.util.Random;

/**
 * @author: zj
 * @Date: 2023/5/16 20:01
 */
public class CodeUtil {
    private static Random random = new Random();

    public static String getRandomNum(int length) {
        StringBuffer sb = new StringBuffer();
        Random random = new Random();
        for (int i = 0; i < length; i++) {
            sb.append(String.valueOf(random.nextInt(10)));
        }
        return sb.toString();
    }

    public static String generateUserUID() {
        return CodeUtil.getRandomNum(9);
    }

    public static String randomCode(int i) {
        return CodeUtil.getRandomNum(i);
    }
}
