SpinResearch / merkle.rs

:christmas_tree: Merkle tree in Rust
BSD 3-Clause "New" or "Revised" License
129 stars 23 forks source link

Introduce a custom `Hashable` trait instead of requiring `AsRef<[u8]> #25

Closed romac closed 7 years ago

romac commented 7 years ago

As not every type can implement AsRef<[u8]>, this PR removes that constraint, and requires instead that values implement the Hashable trait.

A default instance is provided for types that already implements AsRef<[u8]>.