Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Shortest possible shortuuid encoding? #106

Open
mecampbellsoup opened this issue Jul 18, 2024 · 1 comment
Open

Question: Shortest possible shortuuid encoding? #106

mecampbellsoup opened this issue Jul 18, 2024 · 1 comment

Comments

@mecampbellsoup
Copy link

Without dipping below the amount of entropy in a uuid.UUID4, what is the fewest number of base57-encoded characters we could encode to? Is this documented anywhere? If not, do you think it would be a useful thing to mention?

@skorokithakis
Copy link
Owner

Some simple math should get you the number of base57 digits you need to represent 128 bits: 128/log2(57) = 22 digits (which is the length of a shortuuid by default, but maybe that's not documented explicitly).

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

No branches or pull requests

2 participants