[−][src]Trait grin_core::core::id::ShortIdentifiable
A trait for types that have a short_id (inputs/outputs/kernels)
Required methods
fn short_id(&self, hash: &Hash, nonce: u64) -> ShortId
The short_id of a kernel uses a hash built from the block_header and a connection specific nonce to minimize the effect of collisions.
Implementors
impl<H: Hashed> ShortIdentifiable for H
[src]
impl<H: Hashed> ShortIdentifiable for H
fn short_id(&self, hash: &Hash, nonce: u64) -> ShortId
[src]
fn short_id(&self, hash: &Hash, nonce: u64) -> ShortId
Generate a short_id via the following -
- extract k0/k1 from block_hash hashed with the nonce (first two u64
values) * initialize a siphasher24 with k0/k1
- self.hash() passing in the siphasher24 instance
- drop the 2 most significant bytes (to return a 6 byte short_id)