Skip to content

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

Description

@firepacket

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions