commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Caleb Cushing <>
Subject RandomStringUtils with variable lengths
Date Sun, 24 May 2015 20:16:47 GMT
I have written the following for my own project, and a couple of
variants elsewhere (randomNumeric( min, max ) etc.

Also I'm considering maybe a randomGraph() (for printable characters
that match the posix graph regex), and random utf8.

I find these useful for test input data.

 if I wrote it into a patch for RandomStringUtils including docs and
tests would it be accepted/is it something the project would be
interested in? (please cc me I'm not on the list)

public class RandomUtil {
    public static String randomAlphanumeric( final int minLength,
final int maxLength ) {
        return RandomStringUtils.randomAlphanumeric(
RandomUtils.nextInt( minLength, maxLength ) );

Caleb Cushing

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message