Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
oid: use `std::hash::Hasher::hash` over `Hasher::write`
Merged fintohaps opened 6 months ago

Previously, the RepoId was backed by the git2::Oid type, which has a Hash implementation that uses std::hash::Hasher::hash. This uses a length prefixed form for hashing.

When switching to radicle_oid::Oid and implementing Hash without the length prefix, this subtly changed the hashes going forward.

These hashes are used in BloomFilter, which is the type underlying Filter. This resulted in cases where a previous Filter that certainly contained rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 were suddenly reporting that they did not contain this repository.

Changing the implementation of Hash for radicle_oid::Oid fixes this, and is confirmed by adding the regression test in filter.rs.

0 files changed +0 -0 cef0ff57 cef0ff57