Java UUID Create generate()

Here you can find the source of generate()

Description

generate

License

Open Source License

Declaration

public static String generate() 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.UUID;

public class Main {

    public static String generate() {
        UUID uuid = UUID.randomUUID();
        return uuid.toString().replace("-", "");
    }/*from w w w .  j  a  v a2 s.  co m*/

    public static String generate(String userId) {
        UUID uuid = UUID.nameUUIDFromBytes(userId.getBytes());
        return uuid.toString().replace("-", "");
    }
}

Related

  1. generate()
  2. generate()
  3. generate()
  4. generateApiAccesskeyId()
  5. generateAppIds(int noOfAppIdsToGenerate)
  6. generateAttributeId()