{"id":13458704,"url":"https://github.com/f4b6a3/uuid-creator","last_synced_at":"2026-01-14T03:22:16.604Z","repository":{"id":41243766,"uuid":"132057885","full_name":"f4b6a3/uuid-creator","owner":"f4b6a3","description":"UUID Creator is a Java library for generating Universally Unique Identifiers. It generates all standard identifiers from UUIDv1 to UUIDv7. It also provides an alternative to the classic JDK's UUID (alt.GUID), many codecs (codec.*) and several utilities (util.*).","archived":false,"fork":false,"pushed_at":"2025-04-13T04:55:15.000Z","size":2240,"stargazers_count":532,"open_issues_count":0,"forks_count":50,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-07-28T10:10:36.897Z","etag":null,"topics":["guid","id","java","rfc-4122","rfc-9562","uuid","uuidv4","uuidv7"],"latest_commit_sha":null,"homepage":"https://github.com/f4b6a3/uuid-creator","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/f4b6a3.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-03T22:57:00.000Z","updated_at":"2025-07-27T09:49:35.000Z","dependencies_parsed_at":"2022-07-13T00:31:06.811Z","dependency_job_id":"94924180-0842-486f-9fa7-5d267cc82dd7","html_url":"https://github.com/f4b6a3/uuid-creator","commit_stats":null,"previous_names":[],"tags_count":134,"template":false,"template_full_name":null,"purl":"pkg:github/f4b6a3/uuid-creator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f4b6a3%2Fuuid-creator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f4b6a3%2Fuuid-creator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f4b6a3%2Fuuid-creator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f4b6a3%2Fuuid-creator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f4b6a3","download_url":"https://codeload.github.com/f4b6a3/uuid-creator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f4b6a3%2Fuuid-creator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408828,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["guid","id","java","rfc-4122","rfc-9562","uuid","uuidv4","uuidv7"],"created_at":"2024-07-31T09:00:55.409Z","updated_at":"2026-01-14T03:22:16.596Z","avatar_url":"https://github.com/f4b6a3.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"UUID Creator\n======================================================\n\nThis is a Java library for generating [Universally Unique Identifiers](https://en.wikipedia.org/wiki/Universally_unique_identifier).\n\nThis library is fully compliant with [RFC 9562](https://www.rfc-editor.org/rfc/rfc9562), the Internet standard which obsoletes [RFC 4122](https://www.rfc-editor.org/rfc/rfc9562).\n\nList of implemented UUID subtypes:\n\n*   __UUID Version 1__: the Gregorian time-based UUID specified in RFC 9562;\n*   __UUID Version 2__: the DCE Security version, with embedded POSIX UIDs, specified in DCE 1.1;\n*   __UUID Version 3__: the name-based version that uses MD5 hashing specified in RFC 9562;\n*   __UUID Version 4__: The randomly or pseudorandomly generated version specified in RFC 9562;\n*   __UUID Version 5__: the name-based version that uses SHA-1 hashing specified in RFC 9562;\n*   __UUID Version 6__: the reordered Gregorian time-based UUID specified in RFC 9562;\n*   __UUID Version 7__: the Unix Epoch time-based UUID specified in RFC 9562.\n\nThis library solves some of the JDK's UUID issues:\n\n| Problem | Solution |\n|---------|----------|\n| `UUID` can't generate Gregorian time-based UUIDs (UUIDv1). | Use [`UuidCreator.getTimeBased()`](https://javadoc.io/static/com.github.f4b6a3/uuid-creator/5.3.7/com.github.f4b6a3.uuid/com/github/f4b6a3/uuid/UuidCreator.html#getTimeBased()). |\n| `UUID` can't generate SHA-1 UUIDs (UUIDv5). | Use [`UuidCreator.getNameBasedSha1()`](https://javadoc.io/static/com.github.f4b6a3/uuid-creator/5.3.7/com.github.f4b6a3.uuid/com/github/f4b6a3/uuid/UuidCreator.html#getNameBasedSha1(java.util.UUID,java.lang.String)) |\n| `UUID.nameUUIDFromBytes()`, which generates MD5 UUIDs (UUIDv3), does not have a namespace parameter as required by the standard. | Use [`UuidCreator.getNameBasedMd5()`](https://javadoc.io/static/com.github.f4b6a3/uuid-creator/5.3.7/com.github.f4b6a3.uuid/com/github/f4b6a3/uuid/UuidCreator.html#getNameBasedMd5(java.util.UUID,java.lang.String)) |\n| `UUID` has no validation method, which makes developers use `UUID.fromString()` or regular expression for validation. | Use [`UuidValidator.isValid()`](https://javadoc.io/static/com.github.f4b6a3/uuid-creator/5.3.7/com.github.f4b6a3.uuid/com/github/f4b6a3/uuid/util/UuidValidator.html#isValid(java.lang.String)). |\n| Some methods such as `UUID.timestamp()` are strongly related to UUIDv1, even though it's impossible to generate UUIDv1. | Use [`UuidUtil`](https://javadoc.io/static/com.github.f4b6a3/uuid-creator/5.3.7/com.github.f4b6a3.uuid/com/github/f4b6a3/uuid/util/UuidUtil.html). |\n| `UUID.randomUUID()` can be slow due to [lack of entropy](https://medium.com/@RamLakshmanan/java-uuid-generation-performance-impact-cec888b7d9b8) in the operating system. | Use [`UuidCreator.getRandomBasedFast()`](https://javadoc.io/static/com.github.f4b6a3/uuid-creator/5.3.7/com.github.f4b6a3.uuid/com/github/f4b6a3/uuid/UuidCreator.html#getRandomBasedFast()).\u003cbr\u003e\u003cem\u003eHowever, keep in mind that it is not cryptographically secure.\u003c/em\u003e |\n| `UUID.compareTo()` [behaves unexpectedly](https://yoshiori.hatenablog.com/entry/2024/02/22/173322) due to signed `long` comparisons, causing non-alphabetical sorting. | Use [`UuidComparator`](https://javadoc.io/static/com.github.f4b6a3/uuid-creator/5.3.7/com.github.f4b6a3.uuid/com/github/f4b6a3/uuid/util/UuidComparator.html). |\n| `UUID.fromString()` allows non-standard strings like `0-0-0-0-0` as valid UUID strings. | Use [`UuidCreator.fromString()`](https://javadoc.io/static/com.github.f4b6a3/uuid-creator/5.3.7/com.github.f4b6a3.uuid/com/github/f4b6a3/uuid/UuidCreator.html#fromString(java.lang.String)). |\n\nThis project contains a [micro benchmark](https://github.com/f4b6a3/uuid-creator/tree/master/benchmark) and a good amount of [unit tests](https://github.com/f4b6a3/uuid-creator/tree/master/src/test/java/com/github/f4b6a3/uuid), with more than 90% coverage.\n\nFor more information, read the the [Javadocs](https://javadoc.io/doc/com.github.f4b6a3/uuid-creator) and the [Wiki pages](https://github.com/f4b6a3/uuid-creator/wiki).\n\n\u003e **NOTE**:\n\u003e 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.\n\nDependency\n------------------------------------------------------\n\nMaven:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.f4b6a3\u003c/groupId\u003e\n  \u003cartifactId\u003euuid-creator\u003c/artifactId\u003e\n  \u003cversion\u003e6.1.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nGradle:\n\n```\nimplementation 'com.github.f4b6a3:uuid-creator:6.1.0'\n```\n\nSee more options in [maven.org](https://search.maven.org/artifact/com.github.f4b6a3/uuid-creator).\n\n\u003e **HINT:**\n\u003e The `jar` file can be downloaded directly from [maven.org](https://repo1.maven.org/maven2/com/github/f4b6a3/uuid-creator/).\n\n### Modularity\n\nModule and bundle names are the same as the root package name.\n\n*   JPMS module name: `com.github.f4b6a3.uuid`\n*   OSGi symbolic name: `com.github.f4b6a3.uuid`\n\nUsage\n------------------------------------------------------\n\nAll UUID subtypes can be created from the facade [`UuidCreator`](https://javadoc.io/doc/com.github.f4b6a3/uuid-creator/latest/com.github.f4b6a3.uuid/com/github/f4b6a3/uuid/UuidCreator.html).\n\nThe 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.\n\nCreate a [UUIDv1](https://github.com/f4b6a3/uuid-creator/wiki/1.1.-UUIDv1):\n\n```java\nUUID uuid = UuidCreator.getTimeBased();\n```\n\nCreate a [UUIDv2](https://github.com/f4b6a3/uuid-creator/wiki/1.2.-UUIDv2):\n\n```java\nUUID uuid = UuidCreator.getDceSecurity(UuidLocalDomain.LOCAL_DOMAIN_PERSON, 1234);\n```\n\nCreate a [UUIDv3](https://github.com/f4b6a3/uuid-creator/wiki/1.3.-UUIDv3):\n\n```java\nUUID uuid = UuidCreator.getNameBasedMd5(UuidNamespace.NAMESPACE_URL, \"https://github.com/\");\n```\n\nCreate a [UUIDv4](https://github.com/f4b6a3/uuid-creator/wiki/1.4.-UUIDv4):\n\n```java\nUUID uuid = UuidCreator.getRandomBased();\n```\n\nCreate a [UUIDv5](https://github.com/f4b6a3/uuid-creator/wiki/1.5.-UUIDv5):\n\n```java\nUUID uuid = UuidCreator.getNameBasedSha1(UuidNamespace.NAMESPACE_URL, \"https://github.com/\");\n```\n\nCreate a [UUIDv6](https://github.com/f4b6a3/uuid-creator/wiki/1.6.-UUIDv6):\n\n```java\nUUID uuid = UuidCreator.getTimeOrdered();\n```\n\nCreate a [UUIDv7](https://github.com/f4b6a3/uuid-creator/wiki/1.7.-UUIDv7):\n\n```java\nUUID uuid = UuidCreator.getTimeOrderedEpoch();\n```\n\n\u003e **NOTE:**\n\u003e A UUID version is a [**UUID subtype**](https://www.rfc-editor.org/rfc/rfc9562#name-iana-uuid-subtype-registry-). 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**](https://www.rfc-editor.org/rfc/rfc9562#section-4.1). 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.\n\nAlternative API\n------------------------------------------------------\n\n[`GUID`](https://javadoc.io/doc/com.github.f4b6a3/uuid-creator/latest/com.github.f4b6a3.uuid/com/github/f4b6a3/uuid/alt/GUID.html) 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.\n\nThis new API was also designed to be an alternative to [`UuidCreator`](https://javadoc.io/doc/com.github.f4b6a3/uuid-creator/latest/com.github.f4b6a3.uuid/com/github/f4b6a3/uuid/UuidCreator.html) with three goals in mind: clean interface, simple implementation, and high performance. It was inspired by popular libraries for [Javascript](https://www.npmjs.com/package/uuid) and [Python](https://docs.python.org/3/library/uuid.html).\n\n```java\nGUID guid = GUID.v1();\n```\n```java\nGUID guid = GUID.v2(GUID.LOCAL_DOMAIN_PERSON, 1234);\n```\n```java\nGUID guid = GUID.v3(GUID.NAMESPACE_DNS, \"www.example.com\");\n```\n```java\nGUID guid = GUID.v4();\n```\n```java\nGUID guid = GUID.v5(GUID.NAMESPACE_DNS, \"www.example.com\");\n```\n```java\nGUID guid = GUID.v6();\n```\n```java\nGUID guid = GUID.v7();\n```\n\nYou can generate random-based GUIDs by passing an instance of `SecureRandom` as a parameter:\n\n```java\nGUID guid = GUID.v4(new SecureRandom());\n```\n\nYou 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:\n\n```java\nUUID uuid = GUID.v7().toUUID();\n```\n\n\u003e **NOTE:**\n\u003e `GUID` API uses `ThreadLocalRandom` by 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 a `SecureRandom` object to the methods that expect a `Random` parameter.\n\n\nOther identifier generators\n------------------------------------------------------\n\nCheck out the other ID generators from the same family:\n\n*   [ULID Creator](https://github.com/f4b6a3/ulid-creator): Universally Unique Lexicographically Sortable Identifiers\n*   [TSID Creator](https://github.com/f4b6a3/tsid-creator): Time Sortable Identifiers\n*   [KSUID Creator](https://github.com/f4b6a3/ksuid-creator): K-Sortable Unique Identifiers\n\nLicense\n------------------------------------------------------\n\nThis library is Open Source software released under the [MIT license](https://opensource.org/licenses/MIT).\n\n------------------------------------------------------\n\n_Personal Notes:_\n1. _The library can do much more than the examples shown in this document (much more than I should have done). I hope most people find this project useful. In other words, your like is my payment._\n2. _The name of this software is UUID Creator or uuid-creator. Use \"com.github.f4b6a3\" or \"f4b6a3\" only when necessary to avoid doubt, as this is just a unique package name to follow Java convention (now I know it wasn't a good idea)._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff4b6a3%2Fuuid-creator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff4b6a3%2Fuuid-creator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff4b6a3%2Fuuid-creator/lists"}