public class UuidCreator extends Object
| Constructor and Description |
|---|
UuidCreator() |
| Modifier and Type | Method and Description |
|---|---|
static CombGuidCreator |
getCombCreator()
Returns a
CombGuidCreator. |
static UUID |
getCombGuid()
Returns a COMB GUID for MS SQL Server.
|
static UUID |
getDceSecurity(byte localDomain,
int localIdentifier)
Returns a DCE Security UUID based on a local domain and a local
identifier.
|
static DceSecurityUuidCreator |
getDceSecurityCreator()
Returns a
DceSecurityUuidCreator that creates UUID version 2. |
static UUID |
getDceSecurityWithMac(byte localDomain,
int localIdentifier)
Returns a DCE Security UUID with machine address based on a local domain
and a local identifier.
|
static UUID |
getFastRandom()
Returns a fast random UUID.
|
static RandomUuidCreator |
getFastRandomCreator()
Returns a
RandomUuidCreator that creates UUID version 4. |
static MssqlGuidCreator |
getMssqlCreator()
Returns a
MssqlGuidCreator. |
static UUID |
getMssqlGuid()
Returns a time-based GUID for MS SQL Server.
|
static UUID |
getNameBasedMd5(String name)
Returns a UUID based on a name, using MD5.
|
static UUID |
getNameBasedMd5(UUID namespace,
String name)
Returns a UUID based on a name space and a name, using MD5.
|
static NameBasedMd5UuidCreator |
getNameBasedMd5Creator()
Returns a
NameBasedMd5UuidCreator that creates UUID version 3. |
static UUID |
getNameBasedSha1(String name)
Returns a UUID based on a name, using SHA1.
|
static UUID |
getNameBasedSha1(UUID namespace,
String name)
Returns a UUID based on a name space and a name, using SHA1.
|
static NameBasedSha1UuidCreator |
getNameBasedSha1Creator()
Returns a
NameBasedSha1UuidCreator that creates UUID version 5. |
static UUID |
getNameBasedSha256(String name)
Returns a UUID based on a name, using SHA256.
|
static UUID |
getNameBasedSha256(UUID namespace,
String name)
Returns a UUID based on a name space and a name, using SHA256.
|
static NameBasedSha256UuidCreator |
getNameBasedSha256Creator()
Returns a
NameBasedSha256UuidCreator that creates UUID version 4. |
static UUID |
getRandom()
Returns a random UUID.
|
static RandomUuidCreator |
getRandomCreator()
Returns a
RandomUuidCreator that creates UUID version 4. |
static UUID |
getSequential()
Returns a UUID with timestamp and without machine address, but the bytes
corresponding to timestamp are arranged in the "natural" order.
|
static SequentialUuidCreator |
getSequentialCreator()
Returns a
SequentialUuidCreator that creates UUID version 0. |
static UUID |
getSequentialWithMac()
Returns a UUID with timestamp and machine address, but the bytes
corresponding to timestamp are arranged in the "natural" order.
|
static UUID |
getTimeBased()
Returns a UUID with timestamp and without machine address.
|
static TimeBasedUuidCreator |
getTimeBasedCreator()
Returns a
TimeBasedUuidCreator that creates UUID version 1. |
static UUID |
getTimeBasedWithMac()
Returns a UUID with timestamp and machine address.
|
public static UUID getRandom()
SecureRandom with
SHA1PRNG algorithm.
It uses the Details:
- Version number: 4
- Variant number: 1
- Random generator: SecureRandom
public static UUID getFastRandom()
Xorshift128PlusRandom.
Details:
- Version number: 4
- Variant number: 1
- Random generator: Xorshift128PlusRandom
public static UUID getSequential()
Details: - Version number: 0 (non-standard) - Variant number: 1 - Has timestamp?: YES - Has hardware address (MAC)?: NO - Timestamp bytes are in the RFC-4122 order?: NO
public static UUID getSequentialWithMac()
Details: - Version number: 0 (non-standard) - Variant number: 1 - Has timestamp?: YES - Has hardware address (MAC)?: YES - Timestamp bytes are in the RFC-4122 order?: NO
public static UUID getTimeBased()
Details: - Version number: 1 - Variant number: 1 - Has timestamp?: YES - Has hardware address (MAC)?: NO - Timestamp bytes are in the RFC-4122 order?: YES
public static UUID getTimeBasedWithMac()
Details: - Version number: 1 - Variant number: 1 - Has timestamp?: YES - Has hardware address (MAC)?: YES - Timestamp bytes are in the RFC-4122 order?: YES
public static UUID getDceSecurity(byte localDomain, int localIdentifier)
Domain identifiers listed in the RFC-4122: - Local Domain Person (POSIX UserID) = 0; - Local Domain Group (POSIX GroupID) = 1; - Local Domain Org = 2. Details: - Version number: 2 - Variant number: 1 - Local domain: informed by user - Has hardware address (MAC)?: NO - Timestamp bytes are in the RFC-4122 order?: YES
localDomain - a local domainlocalIdentifier - a local identifierpublic static UUID getDceSecurityWithMac(byte localDomain, int localIdentifier)
Domain identifiers listed in the RFC-4122: - Local Domain Person (POSIX UserID) = 0; - Local Domain Group (POSIX GroupID) = 1; - Local Domain Org = 2. Details: - Version number: 2 - Variant number: 1 - Local domain: informed by user - Has hardware address (MAC)?: YES - Timestamp bytes are in the RFC-4122 order?: YES
localDomain - a local domainlocalIdentifier - a local identifierpublic static UUID getNameBasedMd5(String name)
Details: - Version number: 3 - Variant number: 1 - Hash Algorithm: MD5 - Name Space: none
name - a name stringpublic static UUID getNameBasedMd5(UUID namespace, String name)
Details: - Version number: 3 - Variant number: 1 - Hash Algorithm: MD5 - Name Space: informed by user
namespace - a name space UUIDname - a name stringpublic static UUID getNameBasedSha1(String name)
Details: - Version number: 5 - Variant number: 1 - Hash Algorithm: SHA1 - Name Space: none
name - a name stringpublic static UUID getNameBasedSha1(UUID namespace, String name)
Details: - Version number: 5 - Variant number: 1 - Hash Algorithm: SHA1 - Name Space: informed by user
namespace - a name space UUIDname - a name stringpublic static UUID getNameBasedSha256(String name)
Details: - Version number: 4 - Variant number: 1 - Hash Algorithm: SHA256 - Name Space: none
name - a name stringpublic static UUID getNameBasedSha256(UUID namespace, String name)
Details: - Version number: 4 - Variant number: 1 - Hash Algorithm: SHA256 - Name Space: informed by user
namespace - a name space UUIDname - a name stringpublic static UUID getMssqlGuid()
public static UUID getCombGuid()
public static SequentialUuidCreator getSequentialCreator()
SequentialUuidCreator that creates UUID version 0.SequentialUuidCreatorpublic static TimeBasedUuidCreator getTimeBasedCreator()
TimeBasedUuidCreator that creates UUID version 1.TimeBasedUuidCreatorpublic static DceSecurityUuidCreator getDceSecurityCreator()
DceSecurityUuidCreator that creates UUID version 2.DceSecurityUuidCreatorpublic static NameBasedMd5UuidCreator getNameBasedMd5Creator()
NameBasedMd5UuidCreator that creates UUID version 3.NameBasedMd5UuidCreatorpublic static RandomUuidCreator getRandomCreator()
RandomUuidCreator that creates UUID version 4.RandomUuidCreatorpublic static RandomUuidCreator getFastRandomCreator()
RandomUuidCreator that creates UUID version 4.
The random generator used is Xorshift128PlusRandom.RandomUuidCreatorpublic static NameBasedSha1UuidCreator getNameBasedSha1Creator()
NameBasedSha1UuidCreator that creates UUID version 5.NameBasedSha1UuidCreatorpublic static NameBasedSha256UuidCreator getNameBasedSha256Creator()
NameBasedSha256UuidCreator that creates UUID version 4.NameBasedSha256UuidCreatorpublic static MssqlGuidCreator getMssqlCreator()
MssqlGuidCreator.MssqlGuidCreatorpublic static CombGuidCreator getCombCreator()
CombGuidCreator.CombGuidCreatorCopyright © 2019. All rights reserved.