/** * <p> * Generates a variant 2, version 4 (randomly generated number) UUID as per * <a href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a>. * * @return an UUID instance. */ public static UUID randomUUID() { byte[] data = new byte[16]; // lock on the class to protect lazy init synchronized (UUID.class) { if (rng == null) { rng = new SecureRandom(); } } rng.nextBytes(data); return makeUuid(data, 4); }
/** * <p> * Generates a variant 2, version 3 (name-based, MD5-hashed) UUID as per <a * href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a>. * * @param name * the name used as byte array to create an UUID. * @return an UUID instance. */ public static UUID nameUUIDFromBytes(byte[] name) { if (name == null) { throw new NullPointerException("name == null"); } try { MessageDigest md = MessageDigest.getInstance("MD5"); return makeUuid(md.digest(name), 3); } catch (NoSuchAlgorithmException e) { throw new AssertionError(e); } }
/** * <p> * Generates a variant 2, version 4 (randomly generated number) UUID as per * <a href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a>. * * @return an UUID instance. */ public static UUID randomUUID() { byte[] data = new byte[16]; // lock on the class to protect lazy init synchronized (UUID.class) { if (rng == null) { rng = new SecureRandom(); } } rng.nextBytes(data); return makeUuid(data, 4); }
/** * <p> * Generates a variant 2, version 4 (randomly generated number) UUID as per * <a href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a>. * * @return an UUID instance. */ public static UUID randomUUID() { byte[] data = new byte[16]; // lock on the class to protect lazy init synchronized (UUID.class) { if (rng == null) { rng = new SecureRandom(); } } rng.nextBytes(data); return makeUuid(data, 4); }
/** * <p> * Generates a variant 2, version 4 (randomly generated number) UUID as per * <a href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a>. * * @return an UUID instance. */ public static UUID randomUUID() { byte[] data = new byte[16]; // lock on the class to protect lazy init synchronized (UUID.class) { if (rng == null) { rng = new SecureRandom(); } } rng.nextBytes(data); return makeUuid(data, 4); }
/** * <p> * Generates a variant 2, version 4 (randomly generated number) UUID as per * <a href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a>. * * @return an UUID instance. */ public static UUID randomUUID() { byte[] data = new byte[16]; // lock on the class to protect lazy init synchronized (UUID.class) { if (rng == null) { rng = new SecureRandom(); } } rng.nextBytes(data); return makeUuid(data, 4); }
/** * <p> * Generates a variant 2, version 4 (randomly generated number) UUID as per * <a href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a>. * * @return an UUID instance. */ public static UUID randomUUID() { byte[] data = new byte[16]; // lock on the class to protect lazy init synchronized (UUID.class) { if (rng == null) { rng = new SecureRandom(); } } rng.nextBytes(data); return makeUuid(data, 4); }
/** * <p> * Generates a variant 2, version 4 (randomly generated number) UUID as per * <a href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a>. * * @return an UUID instance. */ public static UUID randomUUID() { byte[] data = new byte[16]; // lock on the class to protect lazy init synchronized (UUID.class) { if (rng == null) { rng = new SecureRandom(); } } rng.nextBytes(data); return makeUuid(data, 4); }
/** * <p> * Generates a variant 2, version 4 (randomly generated number) UUID as per * <a href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a>. * * @return an UUID instance. */ public static UUID randomUUID() { byte[] data = new byte[16]; // lock on the class to protect lazy init synchronized (UUID.class) { if (rng == null) { rng = new SecureRandom(); } } rng.nextBytes(data); return makeUuid(data, 4); }
/** * <p> * Generates a variant 2, version 3 (name-based, MD5-hashed) UUID as per <a * href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a>. * * @param name * the name used as byte array to create an UUID. * @return an UUID instance. */ public static UUID nameUUIDFromBytes(byte[] name) { if (name == null) { throw new NullPointerException("name == null"); } try { MessageDigest md = MessageDigest.getInstance("MD5"); return makeUuid(md.digest(name), 3); } catch (NoSuchAlgorithmException e) { throw new AssertionError(e); } }
/** * <p> * Generates a variant 2, version 3 (name-based, MD5-hashed) UUID as per <a * href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a>. * * @param name * the name used as byte array to create an UUID. * @return an UUID instance. */ public static UUID nameUUIDFromBytes(byte[] name) { if (name == null) { throw new NullPointerException("name == null"); } try { MessageDigest md = MessageDigest.getInstance("MD5"); return makeUuid(md.digest(name), 3); } catch (NoSuchAlgorithmException e) { throw new AssertionError(e); } }
/** * <p> * Generates a variant 2, version 3 (name-based, MD5-hashed) UUID as per <a * href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a>. * * @param name * the name used as byte array to create an UUID. * @return an UUID instance. */ public static UUID nameUUIDFromBytes(byte[] name) { if (name == null) { throw new NullPointerException("name == null"); } try { MessageDigest md = MessageDigest.getInstance("MD5"); return makeUuid(md.digest(name), 3); } catch (NoSuchAlgorithmException e) { throw new AssertionError(e); } }
/** * <p> * Generates a variant 2, version 3 (name-based, MD5-hashed) UUID as per <a * href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a>. * * @param name the name used as byte array to create an UUID. * @return an UUID instance. */ public static UUID nameUUIDFromBytes(byte[] name) { if (name == null) { throw new NullPointerException("name == null"); } try { MessageDigest md = MessageDigest.getInstance("MD5"); return makeUuid(md.digest(name), 3); } catch (NoSuchAlgorithmException e) { throw new AssertionError(e); } }
/** * <p> * Generates a variant 2, version 3 (name-based, MD5-hashed) UUID as per <a * href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a>. * * @param name * the name used as byte array to create an UUID. * @return an UUID instance. */ public static UUID nameUUIDFromBytes(byte[] name) { if (name == null) { throw new NullPointerException("name == null"); } try { MessageDigest md = MessageDigest.getInstance("MD5"); return makeUuid(md.digest(name), 3); } catch (NoSuchAlgorithmException e) { throw new AssertionError(e); } }
/** * <p> * Generates a variant 2, version 3 (name-based, MD5-hashed) UUID as per <a * href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a>. * * @param name * the name used as byte array to create an UUID. * @return an UUID instance. */ public static UUID nameUUIDFromBytes(byte[] name) { if (name == null) { throw new NullPointerException("name == null"); } try { MessageDigest md = MessageDigest.getInstance("MD5"); return makeUuid(md.digest(name), 3); } catch (NoSuchAlgorithmException e) { throw new AssertionError(e); } }
/** * <p> * Generates a variant 2, version 3 (name-based, MD5-hashed) UUID as per <a * href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a>. * * @param name * the name used as byte array to create an UUID. * @return an UUID instance. */ public static UUID nameUUIDFromBytes(byte[] name) { if (name == null) { throw new NullPointerException("name == null"); } try { MessageDigest md = MessageDigest.getInstance("MD5"); return makeUuid(md.digest(name), 3); } catch (NoSuchAlgorithmException e) { throw new AssertionError(e); } }