Random String Generator Using Java

This is a simple method to create a random string result, the first method is create string between A-Z and 0-9 while the second one only provide hexadecimal characters.

package com.edw.main;

import java.util.UUID;
import org.apache.commons.lang.RandomStringUtils;

public class Main {
    public static void main(String[] args) {
        // one
        System.out.println(RandomStringUtils.randomAlphanumeric(32).toUpperCase());
        
        // two
        System.out.println(UUID.randomUUID().toString().replace("-", "").toUpperCase());
    }
}

This is the screenshot of my Netbeans Project.

and this is the result,

Hope it helped others, good luck.

Google+

No Comments

Leave a Comment

Please be polite. We appreciate that.
Your email address will not be published and required fields are marked


:-[ (B) (^) (P) (@) (O) (D) :-S ;-( (C) (&) :-$ (E) (~) (K) (I) (L) (8) :-O (T) (G) (F) :-( (H) :-) (*) :-D (N) (Y) :-P (U) (W) ;-)