Skip to content

Make ULID text follow the ULID specification - #21

Merged
rickhohler merged 1 commit into
mainfrom
fix/ulid-spec-compliance
Oct 25, 2026
Merged

rickhohler merged 1 commit into
mainfrom
fix/ulid-spec-compliance

Conversation

@rickhohler

Copy link
Copy Markdown
Collaborator

fix-ulid-spec-compliance (DesignAlgorithmsKit-Specs). Encoding puts the 2
padding bits at the front (first character 0-7) instead of the end, and
parsing matches; strings starting above 7 are rejected. ULID(legacyString:)
reads text from 1.10.x/1.11.x so stored IDs can be migrated; bytes are
unchanged. Spec vectors: 01ARZ3NDEKTSV4RRFFQ69G5FAV round-trips and
timestamp 1469922850259 encodes as 01ARZ3NDEK...

Breaking text format: needs a minor release with the CHANGELOG migration note (planned for the next DAK release).

Tests: swift test passes 369 tests, including the spec vectors and the legacy migration vector 05B3WENNTFB7CK31XYWS60NXBC → 01ARZ3NDEKTSV4RRFFQ69G5FAV.

🤖 Generated with Claude Code

fix-ulid-spec-compliance (DesignAlgorithmsKit-Specs). Encoding puts the 2
padding bits at the front (first character 0-7) instead of the end, and
parsing matches; strings starting above 7 are rejected. ULID(legacyString:)
reads text from 1.10.x/1.11.x so stored IDs can be migrated; bytes are
unchanged. Spec vectors: 01ARZ3NDEKTSV4RRFFQ69G5FAV round-trips and
timestamp 1469922850259 encodes as 01ARZ3NDEK...

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rickhohler
rickhohler merged commit 0c1a2a0 into main Oct 25, 2026
1 check passed
@rickhohler
rickhohler deleted the fix/ulid-spec-compliance branch October 25, 2026 00:45
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