
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
com.github.f4b6a3:uuid-creator
Advanced tools
A Java library to generate RFC-4122 Universally Unique Identifiers (UUID).
This is a Java library for generating Universally Unique Identifiers.
This library is fully compliant with RFC 9562, the Internet standard which obsoletes RFC 4122.
List of implemented UUID subtypes:
This library solves some of the JDK's UUID issues:
| Problem | Solution |
|---|---|
UUID can't generate Gregorian time-based UUIDs (UUIDv1). | Use UuidCreator.getTimeBased(). |
UUID can't generate SHA-1 UUIDs (UUIDv5). | Use UuidCreator.getNameBasedSha1() |
UUID.nameUUIDFromBytes(), which generates MD5 UUIDs (UUIDv3), does not have a namespace parameter as required by the standard. | Use UuidCreator.getNameBasedMd5() |
UUID has no validation method, which makes developers use UUID.fromString() or regular expression for validation. | Use UuidValidator.isValid(). |
Some methods such as UUID.timestamp() are strongly related to UUIDv1, even though it's impossible to generate UUIDv1. | Use UuidUtil. |
UUID.randomUUID() can be slow due to lack of entropy in the operating system. | Use UuidCreator.getRandomBasedFast().However, keep in mind that it is not cryptographically secure. |
UUID.compareTo() behaves unexpectedly due to signed long comparisons, causing non-alphabetical sorting. | Use UuidComparator. |
UUID.fromString() allows non-standard strings like 0-0-0-0-0 as valid UUID strings. | Use UuidCreator.fromString(). |
This project contains a micro benchmark and a good amount of unit tests, with more than 90% coverage.
For more information, read the the Javadocs and the Wiki pages.
NOTE: This software is not supported or maintained by any organization. This information may be useful when having an organization behind a project is a criterion for deciding whether software can be adopted or not.
Maven:
<dependency>
<groupId>com.github.f4b6a3</groupId>
<artifactId>uuid-creator</artifactId>
<version>6.1.1</version>
</dependency>
Gradle:
implementation 'com.github.f4b6a3:uuid-creator:6.1.0'
See more options in maven.org.
HINT: The
jarfile can be downloaded directly from maven.org.
Module and bundle names are the same as the root package name.
com.github.f4b6a3.uuidcom.github.f4b6a3.uuidAll UUID subtypes can be created from the facade UuidCreator.
The goal of the facade is to make most of the library's functionality available in a single place so that you don't have to worry about the internals of the library. All you need is to decide which UUID subtype you need for your application and call the respective generation method. If in doubt, read the documentation and check out the source code.
Create a UUIDv1:
UUID uuid = UuidCreator.getTimeBased();
Create a UUIDv2:
UUID uuid = UuidCreator.getDceSecurity(UuidLocalDomain.LOCAL_DOMAIN_PERSON, 1234);
Create a UUIDv3:
UUID uuid = UuidCreator.getNameBasedMd5(UuidNamespace.NAMESPACE_URL, "https://github.com/");
Create a UUIDv4:
UUID uuid = UuidCreator.getRandomBased();
Create a UUIDv5:
UUID uuid = UuidCreator.getNameBasedSha1(UuidNamespace.NAMESPACE_URL, "https://github.com/");
Create a UUIDv6:
UUID uuid = UuidCreator.getTimeOrdered();
Create a UUIDv7:
UUID uuid = UuidCreator.getTimeOrderedEpoch();
NOTE: A UUID version is a UUID subtype. The word "version" is not used in the sense that a higher version number makes the previous one obsolete. There are 8 subtypes of UUID and each of them is assigned a number; for example, a UUIDv7 is a UUID of subtype 7. Likewise, a UUID variant is a UUID type. There are 4 types of UUID: (1) the prehistoric one, (2) the one described in RFC 9562, (3) the one belonging to Microsoft and (4) the one reserved for the future. RFC 9562 retains the terms “version” and “variant” for compatibility with previous specifications and existing implementations.
GUID is an alternative implementation to the classic JDK's UUID. It also serves as a standalone generator, independent from the rest of the library. This may result in fewer classes being loaded.
This new API was also designed to be an alternative to UuidCreator with three goals in mind: clean interface, simple implementation, and high performance. It was inspired by popular libraries for Javascript and Python.
GUID guid = GUID.v1();
GUID guid = GUID.v2(GUID.LOCAL_DOMAIN_PERSON, 1234);
GUID guid = GUID.v3(GUID.NAMESPACE_DNS, "www.example.com");
GUID guid = GUID.v4();
GUID guid = GUID.v5(GUID.NAMESPACE_DNS, "www.example.com");
GUID guid = GUID.v6();
GUID guid = GUID.v7();
You can generate random-based GUIDs by passing an instance of SecureRandom as a parameter:
GUID guid = GUID.v4(new SecureRandom());
You can also generate JDK's UUIDs using GUID's API. For example, you can generate a JDK's UUID version 7 with this simple statement:
UUID uuid = GUID.v7().toUUID();
NOTE:
GUIDAPI usesThreadLocalRandomby default, which is a non-cryptographic PRNG, so it doesn't block when generating UUIDs. If your project needs a “cryptographic quality” random generator, you can pass aSecureRandomobject to the methods that expect aRandomparameter.
Check out the other ID generators from the same family:
This library is Open Source software released under the MIT license.
Personal Notes:
FAQs
A Java library to generate RFC-4122 Universally Unique Identifiers (UUID).
We found that com.github.f4b6a3:uuid-creator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.