You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hibernate-core/src/main/java/org/hibernate/id/uuid/UuidV6ValueGenerator.java
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,17 @@
20
20
importorg.hibernate.id.UUIDGenerationStrategy;
21
21
22
22
/**
23
-
* Implements a <a href="https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-6">UUID Version 6</a> generation strategy as defined by the {@link UUID#randomUUID()} method.
23
+
* Implements UUID Version 6 generation strategy as defined by the <a href="https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-6">RFC 9562</a>.
24
+
*
25
+
* <ul>
26
+
* <li>32 bits - the most significant 32 bits of the 60-bit starting timestamp.</li>
27
+
* <li>16 bits - the middle 16 bits of the 60-bit starting timestamp.</li>
28
+
* <li>4 bits - version field, set to 0b0110 (6).</li>
29
+
* <li>12 bits - the least significant 12 bits from the 60-bit starting timestamp.</li>
30
+
* <li>2 bits - variant field, set to 0b10.</li>
31
+
* <li>14 bits - the clock sequence, resets to 0 when timestamp changes. </li>
32
+
* <li>48 bits - pseudorandom data to provide uniqueness.</li>
33
+
* </ul>
24
34
*
25
35
* @author Cedomir Igaly
26
36
*/
@@ -66,7 +76,7 @@ public int getGeneratedVersion() {
Copy file name to clipboardExpand all lines: hibernate-core/src/main/java/org/hibernate/id/uuid/UuidV7ValueGenerator.java
+14-14Lines changed: 14 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,19 @@
21
21
importstaticjava.time.temporal.ChronoUnit.MILLIS;
22
22
23
23
/**
24
-
* Implements a <a href="https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-7">UUID Version 7</a> generation strategy as defined by the {@link UUID#randomUUID()} method.
24
+
* Implements UUID Version 7 generation strategy as defined by the <a href="https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-7">RFC 9562</a>.
25
+
*
26
+
* <ul>
27
+
* <li>48 bits - 48-bit big-endian unsigned number of the Unix Epoch timestamp in milliseconds.</li>
28
+
* <li>4 bits - version field, set to 0b0111 (7).</li>
29
+
* <li>
30
+
* 12 bits - sub-milliseconds part of timestamp (resolution approximately 1/4 of millisecond)
31
+
* to guarantee additional monotonicity.
32
+
* </li>
33
+
* <li>2 bits - variant field, set to 0b10.</li>
34
+
* <li>14 bits - counter to guarantee additional monotonicity, resets to 0 when timestamp changes. </li>
35
+
* <li>48 bits - pseudorandom data to provide uniqueness.</li>
36
+
* </ul>
25
37
*
26
38
* @author Cedomir Igaly
27
39
*/
@@ -63,26 +75,14 @@ public int getGeneratedVersion() {
0 commit comments