Skip to content

UuidFactory Class ​

Definition ​

Process-wide UUID generation. Configuration is shared via UuidConfig. For isolated options in the same process, construct a UuidGenerator.

  • Namespace: JASE
  • Assembly: JASE.IdGenerator.dll

Methods ​

NameDescription
Guid Generate(UuidType uuidType)Generates a UUID of the requested type
Guid GenerateForPostgreSql()Generate a timebase UUID using Postgres prefered big-endian / Valid UUID V7
Guid GenerateForSqlServer()Generate a SQL Server–friendly COMB-style GUID with timestamp in the high-order sort bytes for better clustered index locality.
Guid GenerateV4()Generates a UUID V4 identifier
Guid GenerateV7()Generates a UUID V7 identifier
long GetPrimaryKey(Guid id)Derives a clustered 64-bit key from a UUIDv7 or SQL Server COMB value. Layout: upper 48 bits = timestamp (ms since Unix epoch), lower 16 bits = ordered counter/node payload (random tail discarded).
long GetPrimaryKey(string id)Derives a clustered 64-bit key from a UUIDv7 or SQL Server COMB value. Layout: upper 48 bits = timestamp (ms since Unix epoch), lower 16 bits = ordered counter/node payload (random tail discarded).
void SetNodeId(int nodeId)Set the process-wide node id used when UseNode is enabled. Maximum nodes supported is 16 (0..15).