Skip to content

Conversation

@epinault
Copy link
Contributor

Add UUIDv47 implementation with privacy-preserving facades
This commit adds support for UUIDv47, which allows storing time-ordered
UUIDv7 in databases while emitting UUIDv4-looking facades at API boundaries.

Key features:

  • SipHash-2-4 implementation for cryptographic hashing
  • mask/unmask functions for bidirectional UUID conversion
  • Time-ordered database storage with random-looking external IDs
  • Comprehensive test coverage (44 new tests)
  • Complete documentation with usage examples

Files added:

  • lib/siphash.ex: SipHash-2-4 cryptographic hash function
  • lib/uuid_v47.ex: UUIDv47 mask/unmask functionality
  • test/siphash_test.exs: SipHash tests
  • test/uuid_v47_test.exs: UUIDv47 tests
  • guides/UUID_V47.md: Comprehensive documentation

Benefits:

  • Excellent database index performance (time-ordered storage)
  • Privacy preservation (no timestamp leakage in APIs)
  • Deterministic and reversible with secret key
  • Cryptographically secure

Also update some packages and fix some warnings

This commit adds support for UUIDv47, which allows storing time-ordered
UUIDv7 in databases while emitting UUIDv4-looking facades at API boundaries.

Key features:
- SipHash-2-4 implementation for cryptographic hashing
- mask/unmask functions for bidirectional UUID conversion
- Time-ordered database storage with random-looking external IDs
- Comprehensive test coverage (44 new tests)
- Complete documentation with usage examples

Files added:
- lib/siphash.ex: SipHash-2-4 cryptographic hash function
- lib/uuid_v47.ex: UUIDv47 mask/unmask functionality
- test/siphash_test.exs: SipHash tests
- test/uuid_v47_test.exs: UUIDv47 tests
- guides/UUID_V47.md: Comprehensive documentation

Benefits:
- Excellent database index performance (time-ordered storage)
- Privacy preservation (no timestamp leakage in APIs)
- Deterministic and reversible with secret key
- Cryptographically secure
Upgrades stream_data from 0.5.0 to 1.2.0 to resolve deprecation
warnings about register_test/4 being replaced with register_test/6.

This fixes 6 deprecation warnings in property-based tests.
Use Range.new/3 with explicit step parameter to avoid deprecation
warnings when creating ranges that might go backwards (e.g., 1..0).

This fixes the warning:
  Range.new/2 and first..last default to a step of -1 when last < first
Update delete function signature to match Ecto.Adapter.Schema behaviour
which now requires 5 parameters including a 'returning' parameter.

This fixes the warning:
  function delete/5 required by behaviour Ecto.Adapter.Schema
  is not implemented
@epinault epinault mentioned this pull request Oct 10, 2025
@epinault
Copy link
Contributor Author

epinault commented Dec 1, 2025

@bitwalker any chance I can get a review or feedback on this? In ll fix the conflict but I am to make sure you are ok with this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant