[][src]Trait grin_core::core::id::ShortIdentifiable

pub trait ShortIdentifiable {
    fn short_id(&self, hash: &Hash, nonce: u64) -> ShortId;
}

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.

Loading content...

Implementors

impl<H: Hashed> ShortIdentifiable for H[src]

fn short_id(&self, hash: &Hash, nonce: u64) -> ShortId[src]

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)
Loading content...