bitcoin-hash 0.1.20

tools and context for hashing bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// ---------------- [ File: bitcoin-hash/src/block_hasher.rs ]
crate::ix!();

pub struct BlockHasher { }

impl BlockHasher {

    /**
      | this used to call `GetCheapHash()` in
      | uint256, which was later moved; the cheap
      | hash function simply calls ReadLE64()
      | however, so the end result is identical
      */
    #[instrument(level = "debug", skip(self, hash))]
    pub fn invoke(&self, hash: &u256) -> usize {
        read_le64(hash.as_ref()) as usize
    }
}