Skip to content

Commit 1cde634

Browse files
authored
Add UUID descriptions (#106)
1 parent c037943 commit 1cde634

1 file changed

Lines changed: 20 additions & 6 deletions

File tree

README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,31 @@ UUID version 7 features a time-ordered value field derived from the widely imple
4141

4242
If your use case requires greater granularity than UUID version 7 can provide, you might consider UUID version 8. UUID version 8 doesn't provide as good entropy characteristics as UUID version 7, but it utilizes timestamp with nanosecond level of precision.
4343

44-
## UUIDv6 Field and Bit Layout
44+
## UUID Version 6
45+
46+
UUID version 6 is a field-compatible version of UUIDv1, reordered for improved DB locality. It is expected that UUIDv6 will primarily be used in contexts where there are existing v1 UUIDs. Systems that do not involve legacy UUIDv1 **SHOULD** use UUIDv7 instead.
47+
48+
### UUIDv6 Field and Bit Layout
4549

4650
```
4751
0 1 2 3
4852
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
4953
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
5054
| time_high |
5155
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
52-
| time_mid | time_low_and_version |
56+
| time_mid | ver | time_low |
5357
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
54-
|clk_seq_hi_res | clk_seq_low | node (0-1) |
58+
|var| clock_seq | node |
5559
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
56-
| node (2-5) |
60+
| node |
5761
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
5862
```
5963

60-
## UUIDv7 Field and Bit Layout
64+
## UUID Version 7
65+
66+
UUID version 7 features a time-ordered value field derived from the widely implemented and well known Unix Epoch timestamp source, the number of milliseconds seconds since midnight 1 Jan 1970 UTC, leap seconds excluded. UUID version 7 also has improved entropy characteristics over versions 1 or 6.
67+
68+
### UUIDv7 Field and Bit Layout
6169

6270
```
6371
0 1 2 3
@@ -73,7 +81,13 @@ If your use case requires greater granularity than UUID version 7 can provide, y
7381
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
7482
```
7583

76-
## UUIDv8 Field and Bit Layout
84+
## UUID Version 8
85+
86+
UUID version 8 provides an RFC-compatible format for experimental or vendor-specific use cases.
87+
88+
This implementation of `uuid8()` sacrifices some entropy for granularity compared to `uuid7()`, while being otherwise compatible.
89+
90+
### UUIDv8 Field and Bit Layout
7791

7892
```
7993
0 1 2 3

0 commit comments

Comments
 (0)