 |
Bitcoin Core
22.99.0
P2P Digital Currency
|
Go to the documentation of this file.
83 template<
typename T1,
typename T2>
157 template<
typename Source>
174 std::byte data[1024];
176 size_t now = std::min<size_t>(nSize, 1024);
205 void BIP32Hash(
const ChainCode &chainCode,
unsigned int nChild,
unsigned char header,
const unsigned char data[32],
unsigned char output[64]);
215 #endif // BITCOIN_HASH_H
static uint64_t ReadLE64(const unsigned char *ptr)
CHashVerifier(Source *source_)
uint256 SerializeHash(const T &obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION)
Compute the 256-bit hash of an object's serialization.
constexpr auto MakeUCharSpan(V &&v) -> decltype(UCharSpanCast(Span
Like the Span constructor, but for (const) unsigned char member types only.
CSHA256 & Write(const unsigned char *data, size_t len)
A hasher class for RIPEMD-160.
CHash256 & Write(Span< const unsigned char > input)
Reads data from an underlying stream, while hashing the read data.
CHashWriter & operator<<(const T &obj)
void Finalize(unsigned char hash[OUTPUT_SIZE])
uint256 GetSHA256()
Compute the SHA256 hash of all data written to this object.
void ignore(size_t nSize)
uint256 SHA256Uint256(const uint256 &input)
Single-SHA256 a 32-byte input (represented as uint256).
static const size_t OUTPUT_SIZE
void Unserialize(Stream &, char)=delete
void Serialize(Stream &, char)=delete
constexpr std::size_t size() const noexcept
A Span is an object that can refer to a contiguous sequence of objects.
uint256 Hash(const T &in1)
Compute the 256-bit hash of an object.
static const size_t OUTPUT_SIZE
unsigned char * UCharCast(char *c)
A hasher class for Bitcoin's 160-bit hash (SHA-256 + RIPEMD-160).
CRIPEMD160 & Write(const unsigned char *data, size_t len)
void Finalize(Span< unsigned char > output)
void Finalize(Span< unsigned char > output)
void Finalize(unsigned char hash[OUTPUT_SIZE])
static const size_t OUTPUT_SIZE
void read(Span< std::byte > dst)
unsigned int MurmurHash3(unsigned int nHashSeed, Span< const unsigned char > vDataToHash)
constexpr C * data() const noexcept
CHashWriter(int nTypeIn, int nVersionIn)
uint160 Hash160(const T1 &in1)
Compute the 160-bit hash an object.
CHashWriter TaggedHash(const std::string &tag)
Return a CHashWriter primed for tagged hashes (as specified in BIP 340).
uint64_t GetCheapHash()
Returns the first 64 bits from the resulting hash.
void BIP32Hash(const ChainCode &chainCode, unsigned int nChild, unsigned char header, const unsigned char data[32], unsigned char output[64])
CHashVerifier< Source > & operator>>(T &&obj)
A writer stream (for serialization) that computes a 256-bit hash.
CHash160 & Write(Span< const unsigned char > input)
A hasher class for SHA-256.
A hasher class for Bitcoin's 256-bit hash (double SHA-256).
uint256 GetHash()
Compute the double-SHA256 hash of all data written to this object.
static const size_t OUTPUT_SIZE
void write(Span< const std::byte > src)
static const int PROTOCOL_VERSION
network protocol versioning