Skip to content

Feature request: Flag to opt into higher quality hashing. #1240

@LukeAbby

Description

@LukeAbby

I was fixing this error:

[9, 49, 1, "Type \'WordTreeEntry\' does not satisfy the constraint \'{ [x string] never; [x number] never; [leaves] never; }\'.\\n  Property \'[StringTree.leaves]\' is missing in type \'WordTreeEntry\' but required in type \'{ [x string] never; [x number] never; [leaves] never; }\'.", "177612"]

And I accidentally introduced this error:

[15, 101, 1, "Cannot find name \'voi\'.", "177612"]

However Betterer didn't warn me because they just happened to have the same hash. It looks like you use djb2a which is non-cryptographic which probably accounts for this collision because the purported hash space is 32-bits so a collision occurring when I only had 4 errors in that file before should have been 4/2^32 or a ~0.000_000_09% chance. That should be a worse than a 1 in a billion chance.

This probability is accurate because this can be modeled as a "draw without replacement" and while of course many people have updated their .betterer.results file before I would be inclined to say it's not been in the billions.

I would welcome a flag to opt into a cryptographic or at least higher resolution and quality hash.

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