Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java random uuid

String id = UUID.randomUUID().toString();
Comment

java generate uuid

public static void main(String[] args) {
    final String uuid = UUID.randomUUID().toString().replace("-", "");
    System.out.println("uuid = " + uuid);
}
Comment

java random uuid


import java.security.SecureRandom;
import java.util.UUID;

public class RandomUtil {
    // Maxim: Copied from UUID implementation :)
    private static volatile SecureRandom numberGenerator = null;
    private static final long MSB = 0x8000000000000000L;

    public static String unique() {
        SecureRandom ng = numberGenerator;
        if (ng == null) {
            numberGenerator = ng = new SecureRandom();
        }

        return Long.toHexString(MSB | ng.nextLong()) + Long.toHexString(MSB | ng.nextLong());
    }       
}

Comment

PREVIOUS NEXT
Code Example
Java :: java uuid 
Java :: what language is android written in 
Java :: Horizontal RecyclerView android example 
Java :: what is java plug-in 
Java :: java do something after x seconds without stopping everything else 
Java :: boolean print condition java 
Java :: 64 encode java 
Java :: android time 
Java :: loop java 
Java :: jframe actionlistener 
Java :: spring h2 database example 
Java :: toast no android 
Java :: hashmap iteration 
Java :: how to add animation between activity in android 
Java :: float maximum value java 
Java :: get text from a jtextfield 
Java :: static int java 
Java :: java flowlayout 
Java :: Problem adding rectangle in javaFX 
Java :: nested for each loop java 
Java :: Validation failed for query for method public abstract java.util.List 
Java :: string to string array java 
Java :: java distinct by key 
Java :: java 8 map foreach 
Java :: java date to string 
Java :: running sum of 1d array 
Java :: java create new arraylist with elements 
Java :: double.parsedouble in java 
Java :: milliseconds to seconds java 
Java :: switch case java with char 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =