Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static final String AB = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
- static SecureRandom rnd = new SecureRandom();
- public static String randomString( int len ){
- StringBuilder sb = new StringBuilder( len );
- for( int i = 0; i < len; i++ )
- sb.append( AB.charAt( rnd.nextInt(AB.length()) ) );
- return sb.toString();
- }
Add Comment
Please, Sign In to add comment