package com.test.bijihoudaun.util;

public class RandomString {

    // 生成指定长度的随机字符串
    public static String generateRandomString(int length) {
        String chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
        StringBuilder result = new StringBuilder();

        for (int i = 0; i < length; i++) {
            int randomIndex = (int) (Math.random() * chars.length());
            result.append(chars.charAt(randomIndex));
        }
        return result.toString();
    }
}
