Closed timstokman closed 2 months ago
As far as I know, every UUID generated by UUIDNext have the correct version and variant bit set.
Can you provide some code examples where UUIDNext fails to set those bits ?
I'm sorry, I think might've hit the sql server path somewhere, which doesn't generate UUIDv7. Sorry for wasting your time.
Ok, no problem.
Uuid.NewDatabaseFriendly(Database.SqlServer) generates UUID V8 which is the version for creating custom UUIDs
According to the standard:
I checked with other UUIDv7 generators (as in https://www.npmjs.com/package/uuidv7/v/0.5.3), and those libraries do fill those fields in a compliant way. Your library doesn't match. Might be a bit of a compatibility issue, makes it harder for libraries to recognize they're dealing with UUIDv7, might be compatibility issues.
.NET 9 also sets these fields correctly: https://github.com/dotnet/runtime/blob/039697860b0985bfaecd4e6d37e2968516daad9d/src/libraries/System.Private.CoreLib/src/System/Guid.cs
See Version7Value.