File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/Common/Polyfills/System Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,11 @@ internal static class GuidHelpers
1010 private static long s_counter ;
1111
1212 /// <summary>
13- /// Creates a monotonically increasing UUID v7 GUID with the specified timestamp.
13+ /// Creates a monotonically increasing GUID using a UUIDv7-like format with the specified timestamp.
1414 /// Uses a globally increasing counter for strict monotonicity.
1515 /// </summary>
1616 /// <param name="timestamp">The timestamp to embed in the GUID.</param>
17- /// <returns>A new monotonically increasing UUID v7 GUID.</returns>
17+ /// <returns>A new monotonically increasing GUID.</returns>
1818 /// <remarks>
1919 /// <para>
2020 /// This method cannot be replaced with <c>Guid.CreateVersion7(DateTimeOffset)</c> because
@@ -25,11 +25,13 @@ internal static class GuidHelpers
2525 /// <para>
2626 /// This implementation uses a globally monotonically increasing counter to ensure that
2727 /// all generated GUIDs are strictly ordered by creation time, regardless of timestamp.
28+ /// The format is UUIDv7-like but not RFC 9562 compliant since we prioritize strict
29+ /// monotonicity over random bits in the counter field.
2830 /// </para>
2931 /// </remarks>
3032 public static Guid CreateMonotonicUuid ( DateTimeOffset timestamp )
3133 {
32- // UUID v7 format (RFC 9562):
34+ // UUIDv7-like format (based on RFC 9562 structure, but uses counter instead of random for strict monotonicity ):
3335 // - 48 bits: Unix timestamp in milliseconds (big-endian)
3436 // - 4 bits: version (0111 = 7)
3537 // - 12 bits: counter/sequence (for intra-millisecond ordering)
You can’t perform that action at this time.
0 commit comments