feat: add UUIDv7
support with encoding options
#65
+125
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Addressing the issue #61, this PR introduces
UUIDv7
support toshortuuid
, bringing time-ordered UUID generation to our library.What does the PR implement?
NewV7
: Generates a UUIDv7 using the default base57 alphabet.NewV7WithEncoder
: Allows encoding UUIDv7 with a custom encoder.NewV7WithNamespace
: Creates a UUIDv5 (or UUIDv7 if the namespace is empty) and encodes it.NewV7WithAlphabet
: Encodes UUIDv7 with a custom alphabet.Adds Unit Tests including Benchmarks. No breaking changes; everything is backward-compatible.