Class UuidVersion6Strategy

java.lang.Object
org.hibernate.id.uuid.UuidVersion6Strategy
All Implemented Interfaces:
Serializable, UuidValueGenerator, UUIDGenerationStrategy

public class UuidVersion6Strategy extends Object implements UUIDGenerationStrategy, UuidValueGenerator
Implements UUID Version 6 generation strategy as defined by the RFC 9562.
  • 32 bits - the most significant 32 bits of the 60-bit starting timestamp.
  • 16 bits - the middle 16 bits of the 60-bit starting timestamp.
  • 4 bits - version field, set to 0b0110 (6).
  • 12 bits - the least significant 12 bits from the 60-bit starting timestamp.
  • 2 bits - variant field, set to 0b10.
  • 14 bits - the clock sequence, resets to 0 when timestamp changes.
  • 48 bits - pseudorandom data to provide uniqueness.
See Also:
API Note:
This strategy is field-compatible with Version 1, with the time bits reordered for improved DB locality.