Skip to content

Encode String and Symbol unique names in base 62#180

Merged
mtfishman merged 4 commits into
mainfrom
mf/uniquename-base62
Jun 22, 2026
Merged

Encode String and Symbol unique names in base 62#180
mtfishman merged 4 commits into
mainfrom
mf/uniquename-base62

Conversation

@mtfishman

@mtfishman mtfishman commented Jun 22, 2026

Copy link
Copy Markdown
Member

Summary

Encodes the string 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 no longer routing the string and symbol cases through uuid4. 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. A requested AbstractString subtype is preserved rather than always returning a String.

IndexName still mints and stores a UUID, so index identity and its display are unchanged. This only affects cases where the name type is itself a string or Symbol.

## 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

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.75%. Comparing base (d544786) to head (d9e08d1).

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              
Flag Coverage Δ
docs 21.27% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mtfishman mtfishman merged commit 32c2f3d into main Jun 22, 2026
18 checks passed
@mtfishman mtfishman deleted the mf/uniquename-base62 branch June 22, 2026 15:29
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