Skip to content

geo_filters: Allow user to specify hasher #68

@itsibitzi

Description

@itsibitzi

Right now we use the standard library hash map Hasher in the Count trait: https://github.com/github/rust-gems/blob/main/crates/geo_filters/src/lib.rs#L56-L61

There's a TODO to use a stable hash function, meaning one that doesn't change as different versions of Rust are released. This is important because if two machines are e.g. comparing geofilters then a different hash function would result in meaningless output.

This proposed change allows the user of the library to specify what hash function they would like to use. This allows them to specify the hash function they want to use on both sides, ensuring the hash values for the same are consistent. It also has a side benefit of making the library more flexible if better hash functions become available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions