Skip to content

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

@firepacket

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.

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