Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
HashWriter Class Reference

A writer stream (for serialization) that computes a 256-bit hash. More...

#include <hash.h>

Inheritance diagram for HashWriter:
[legend]
Collaboration diagram for HashWriter:
[legend]

Public Member Functions

void write (Span< const std::byte > src)
 
uint256 GetHash ()
 Compute the double-SHA256 hash of all data written to this object.
 
uint256 GetSHA256 ()
 Compute the SHA256 hash of all data written to this object.
 
uint64_t GetCheapHash ()
 Returns the first 64 bits from the resulting hash.
 
template<typename T >
HashWriteroperator<< (const T &obj)
 

Private Attributes

CSHA256 ctx
 

Detailed Description

A writer stream (for serialization) that computes a 256-bit hash.

Definition at line 99 of file hash.h.

Member Function Documentation

◆ GetCheapHash()

uint64_t HashWriter::GetCheapHash ( )
inline

Returns the first 64 bits from the resulting hash.

Definition at line 136 of file hash.h.

Here is the call graph for this function:

◆ GetHash()

uint256 HashWriter::GetHash ( )
inline

Compute the double-SHA256 hash of all data written to this object.

Invalidates this object.

Definition at line 113 of file hash.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSHA256()

uint256 HashWriter::GetSHA256 ( )
inline

Compute the SHA256 hash of all data written to this object.

Invalidates this object.

Definition at line 127 of file hash.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator<<()

template<typename T >
HashWriter & HashWriter::operator<< ( const T &  obj)
inline

Definition at line 141 of file hash.h.

Here is the call graph for this function:

◆ write()

void HashWriter::write ( Span< const std::byte >  src)
inline

Definition at line 104 of file hash.h.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ ctx

CSHA256 HashWriter::ctx
private

Definition at line 101 of file hash.h.


The documentation for this class was generated from the following file: