pub trait KitsuneBinType: 'static + Send + Sync + Debug + Clone + Hash + PartialEq + Eq + PartialOrd + Ord + Into<Vec<u8>> {
    fn new(bytes: Vec<u8>) -> Self;
    fn get_bytes(&self) -> &[u8]Notable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8];
    fn get_loc(&self) -> DhtLocation;
}
Expand description

Kitsune hashes are expected to be 36 bytes. The first 32 bytes are the proper hash. The final 4 bytes are a hash-of-the-hash that can be treated like a u32 “location”.

Required Methods

Create an instance, ensuring the proper number of bytes were provided.

Fetch just the core 32 bytes (without the 4 location bytes).

Fetch the dht “loc” / location for this hash.

Implementors