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 insert at index 
Java :: armstrong number in java 
Java :: statusbar text color android 
Java :: radio button android:inputType 
Java :: java throw keyword 
Java :: glide dependency 
Java :: java run cmd 
Java :: java.lang.object[4] 
Java :: java formatted output 
Java :: math.absolute java 
Java :: java logger with different colors 
Java :: how to clear text fields in java 
Java :: java constructor overloading 
Java :: Java How to use SortedSet? 
Java :: java standard exceptions 
Java :: java inheritance 
Java :: comentario java 
Java :: hide steam games from friends 
Java :: esponente in java 
Java :: check if a list contains a string java 
Java :: apache csv get headers 
Java :: java delete object 
Java :: find highest value in keyset java 
Java :: integer.tobinarystring returns 
Java :: word count in a string using HashMap Collection 
Java :: lambda java 
Java :: float java 
Java :: how to add textview to listview in android 
Java :: java convert pdf to image 
Java :: How to efficiently find the start node of a loop within a singly linked list, in Java? 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =