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

Shortner method is terrible, will result in collisions and will always be 4 chars. #298

Open
firepacket opened this issue May 15, 2021 · 0 comments

Comments

@firepacket
Copy link

hash = hasha(url, {encoding:"base64", algorithm:"md5"}); hash = hash.slice(0,4);

If you're going to make a site like this at least find out how to do it properly.
Your first few thousand links should be 2 chars, and go up slowly from there with zero collisions.
(1/36)*4 = 11% collisions.

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

1 participant