Skip to content

Hashing gives different results on 32-bit platforms #15

Description

@jeff-k

Seq, Kmer, and SeqSlice hashes for the same sequences should be equal. They are, but not between hardware platforms. There is a note about this in the siphash docs: https://docs.rs/siphasher/latest/siphasher/#note

This effects bio-seq even though we only provide a hasher-agnostic implementation of the Hash trait.

The problem is that we're using the bitvec crate's hash implementation under the hood, which does not follow the guidance above: https://docs.rs/bitvec/latest/src/bitvec/slice/traits.rs.html#532-542

The solution should be to hash the bytes (or u32s?) of the sequence datastructures without calling the bitvec implementation. Shouldn't be too hard.

This motivates moving away from bitvec, as hinted in #10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions