All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.revenuemonster.util.RandomString Maven / Gradle / Ivy

Go to download

This is an Java SDK that maps some of the RESTful methods of Open API that are documented at doc.revenuemonster.my

The newest version!
package com.github.revenuemonster.util;

import java.time.Instant;
import java.util.Random;

public class RandomString {
    private static Random random = new Random(Instant.now().getEpochSecond());
    public static String GenerateRandomString(int size){
        StringBuilder builder = new StringBuilder();
        char ch;
        for (int i = 0; i < size; i++)
        {
            ch = (char)((int)Math.floor(26 * random.nextDouble() + 65));
            builder.append(ch);
        }
        return builder.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy