Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiolimace committed Jul 7, 2024
1 parent ad485de commit 0e6a878
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This version has breaking changes.
- Removed `UuidCreator.getNameBasedMD5()` with `UUID` as name parameter (deprecated);
- Removed `UuidCreator.getNameBasedSHA1()` with `UUID` as name parameter (deprecated);
- Removed several code-smells in order improve code-quality and adhere to SOLID principles (by Jay Patel);
- Updated references to the standard RFC 9562;
- Updated references to the IETF standard RFC 9562;
- Many refactorings and optimizations.

## [5.3.7] - 2023-12-22
Expand Down
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ Create a [UUIDv7](https://github.com/f4b6a3/uuid-creator/wiki/1.7.-UUIDv7):
```java
UUID uuid = UuidCreator.getTimeOrderedEpoch();
```

> **NOTE:**
> 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.
Expand Down Expand Up @@ -146,18 +147,14 @@ GUID guid = GUID.v6();
GUID guid = GUID.v7();
```

> **NOTE:**
> It uses a **non-cryptographic** PRNG. So it doesn't block when generating random-based UUIDs. However, it is not recommended when the security provided by “cryptographic quality” generators is considered necessary.
### Generate JDK's UUID using the alternative API

You can generate JDK's UUIDs using GUID's API. For example, you can generate a JDK's UUID version 7 with this simple statement:

```java
UUID uuid = GUID.v7().toUUID();
```

When you call `toUUID()` the internal value of GUID is copied to the new JDK's UUID.
> **NOTE:**
> It uses a **non-cryptographic** PRNG. So it doesn't block when generating random-based UUIDs. However, it is not recommended when the security provided by “cryptographic quality” generators is considered necessary.
Other identifier generators
------------------------------------------------------
Expand Down

0 comments on commit 0e6a878

Please sign in to comment.