commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Caleb Cushing <xenoterrac...@gmail.com>
Subject Fwd: RandomStringUtils with variable lengths
Date Fri, 29 May 2015 00:12:29 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?

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


--
Caleb Cushing

http://xenoterracide.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message