package com.eactive.eai.rms.onl.apim.approval;

public class RandomStringGenerator {
    private static final String CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

    public static String generateString(int length) {
        StringBuilder result = new StringBuilder(length);
        int charactersLength = CHARACTERS.length();

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

        return result.toString();
    }
}
