package com.hfkj.common.utils;

import java.util.Random;

/**
  * @ClassName RandomStringGeneratorUtil
  * @Author Sum1Dream
  * @Description  生成随机数
  * @Date 2024/8/27 上午11:33
 **/
public class RandomStringGeneratorUtil {

    public static String generateRandomString(int stringLength) {
        char[] chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890".toCharArray();
        StringBuilder sb = new StringBuilder();
        Random random = new Random();
        for (int i = 0; i < stringLength; i++) {
            char c = chars[random.nextInt(chars.length)];
            sb.append(c);
        }
        return sb.toString();
    }
}
