Skip to content

Adds compact_time for better collision resistance#19

Merged
johnnyt merged 1 commit intomainfrom
18-compact-time
Jan 16, 2026
Merged

Adds compact_time for better collision resistance#19
johnnyt merged 1 commit intomainfrom
18-compact-time

Conversation

@johnnyt
Copy link
Member

@johnnyt johnnyt commented Jan 16, 2026

Adds support for compact timestamps that trade 8 bits of timestamp precision for 8 additional bits of randomness. This improves collision resistance for small UXIDs while maintaining k-sortability until 2039.

Features:

  • Global policy via compact_small_times config
  • Per-call override via compact_time option
  • Automatic format detection in decoder
  • Epoch reconstruction for timestamp accuracy
  • Ecto schema support for per-field configuration

Closes #18

Adds support for compact timestamps that trade 8 bits of timestamp
precision for 8 additional bits of randomness. This improves collision
resistance for small UXIDs while maintaining k-sortability until 2039.

Features:
- Global policy via compact_small_times config
- Per-call override via compact_time option
- Automatic format detection in decoder
- Epoch reconstruction for timestamp accuracy
- Ecto schema support for per-field configuration

Closes #18
@johnnyt johnnyt merged commit 1a423d4 into main Jan 16, 2026
1 check passed
@johnnyt johnnyt deleted the 18-compact-time branch January 16, 2026 15:44
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.

Add ability to swap better time precision with more randomness for small and xsmall UXIDs

1 participant