Hasty Briefsbeta

UUIDv47: Store UUIDv7 in DB, emit UUIDv4 outside (SipHash-masked timestamp)

7 hours ago
  • #Database
  • #UUID
  • #Security
  • uuidv47 allows storing sortable UUIDv7 in databases while presenting a UUIDv4-like façade at API boundaries.
  • Uses XOR-masking on the UUIDv7 timestamp field with a keyed SipHash-2-4 stream tied to the UUID’s random bits.
  • Features include header-only C (C89), zero dependencies, deterministic and invertible mapping, and RFC-compatible version/variant bits.
  • Provides key-recovery resistance using SipHash-2-4 with a 128-bit key.
  • Includes full tests, quick start guide, public API details, and comprehensive documentation.
  • UUIDv7 is time-ordered, improving index locality and pagination.
  • The façade hides timing patterns, making it appear as UUIDv4 to clients/systems.
  • Uses SipHash-2-4 for security, ensuring the key does not leak.
  • Includes build, test, and coverage instructions, along with integration tips and performance notes.
  • FAQ addresses common questions about security and indistinguishability from UUIDv4.
  • Licensed under MIT.