Encode String and Symbol unique names in base 62#180
Merged
Conversation
## Summary Encodes the `String` and `Symbol` outputs of `uniquename` in base 62 (`[0-9A-Za-z]`) rather than as a dashed hexadecimal UUID string, shrinking a freshly minted name from 36 to 22 characters and dropping the `UUIDs` dependency from this code path. The encoding draws a full 128 random bits (`rand(rng, UInt128)`), where the previous `uuid4`-based string fixed 6 of them for the UUID version and variant. `IndexName` still mints and stores a `UUID`, so index identity and its display are unchanged. This only affects the cases where the name type is itself `String` or `Symbol`. Co-authored-by: Claude <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #180 +/- ##
==========================================
+ Coverage 74.72% 74.75% +0.02%
==========================================
Files 20 20
Lines 1104 1105 +1
==========================================
+ Hits 825 826 +1
Misses 279 279
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Encodes the string outputs of
uniquenamein base 62 ([0-9A-Za-z]) rather than as a dashed hexadecimal UUID string, shrinking a freshly minted name from 36 to 22 characters and no longer routing the string and symbol cases throughuuid4. The encoding draws a full 128 random bits (rand(rng, UInt128)), where the previousuuid4-based string fixed 6 of them for the UUID version and variant. A requestedAbstractStringsubtype is preserved rather than always returning aString.IndexNamestill mints and stores aUUID, so index identity and its display are unchanged. This only affects cases where the name type is itself a string orSymbol.