Trait kitsune_p2p_types::bin_types::KitsuneBinType
source · [−]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) -> u32;
}
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).