Changeset View
Changeset View
Standalone View
Standalone View
src/util/hasher.h
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | struct BlockHasher { | ||||
// this used to call `GetCheapHash()` in uint256, which was later moved; the | // this used to call `GetCheapHash()` in uint256, which was later moved; the | ||||
// cheap hash function simply calls ReadLE64() however, so the end result is | // cheap hash function simply calls ReadLE64() however, so the end result is | ||||
// identical | // identical | ||||
size_t operator()(const BlockHash &hash) const { | size_t operator()(const BlockHash &hash) const { | ||||
return ReadLE64(hash.begin()); | return ReadLE64(hash.begin()); | ||||
} | } | ||||
}; | }; | ||||
class SaltedSipHasher { | |||||
private: | |||||
/** Salt */ | |||||
const uint64_t m_k0, m_k1; | |||||
public: | |||||
SaltedSipHasher(); | |||||
size_t operator()(const Span<const uint8_t> &script) const; | |||||
}; | |||||
#endif // BITCOIN_UTIL_HASHER_H | #endif // BITCOIN_UTIL_HASHER_H |