Sequential Guid
Sequential Guid is a .NET Standard 2.1 NuGet package for generating GUIDs in the ordering used by SQL Server. It is intended for cases where incrementing identifiers are preferred over entirely random GUID values.
How it works
The package keeps a current GUID and increments its bytes using a SQL Server-specific byte-order map. It starts from 00000000-0000-0000-0000-000000000001 by default, or an application can explicitly set a starting seed.
The public API is deliberately small:
GuidInstance.Next()returns the next sequential GUID.GuidInstance.GetCurrentGuid()returns the last generated GUID.GuidInstance.SetSeed(Guid)replaces the current starting point.
The project includes tests that verify a generated value compares greater than the preceding value and that seeding updates the current value. The package is published as Knourian.SequentialGuid.