CCF
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
ccf::crypto::Sha256Hash Class Reference

#include <sha256_hash.h>

Public Types

using Representation = std::array< uint8_t, SIZE >
 

Public Member Functions

 Sha256Hash ()=default
 
void set (const Representation &r)
 
 Sha256Hash (const uint8_t *data, size_t size)
 
 Sha256Hash (const std::vector< uint8_t > &vec)
 
 Sha256Hash (const std::string &str)
 
 Sha256Hash (const Sha256Hash &left, const Sha256Hash &right)
 
 Sha256Hash (const Sha256Hash &first, const Sha256Hash &second, const Sha256Hash &third)
 
 Sha256Hash (const Sha256Hash &hash)=default
 
Sha256Hashoperator= (const Sha256Hash &hash)=default
 
 Sha256Hash (Sha256Hash &&hash) noexcept
 
Sha256Hashoperator= (Sha256Hash &&hash) noexcept
 
std::string hex_str () const
 

Static Public Member Functions

static Sha256Hash from_hex_string (const std::string &str)
 
static Sha256Hash from_span (const std::span< const uint8_t, SIZE > &sp)
 
static Sha256Hash from_representation (const Representation &r)
 

Public Attributes

Representation h = {0}
 

Static Public Attributes

static constexpr size_t SIZE = 256 / 8
 

Friends

std::ostream & operator<< (std::ostream &os, const ccf::crypto::Sha256Hash &h)
 

Member Typedef Documentation

◆ Representation

using ccf::crypto::Sha256Hash::Representation = std::array<uint8_t, SIZE>

Constructor & Destructor Documentation

◆ Sha256Hash() [1/8]

ccf::crypto::Sha256Hash::Sha256Hash ( )
default

◆ Sha256Hash() [2/8]

ccf::crypto::Sha256Hash::Sha256Hash ( const uint8_t *  data,
size_t  size 
)

◆ Sha256Hash() [3/8]

ccf::crypto::Sha256Hash::Sha256Hash ( const std::vector< uint8_t > &  vec)
explicit

◆ Sha256Hash() [4/8]

ccf::crypto::Sha256Hash::Sha256Hash ( const std::string &  str)
explicit

◆ Sha256Hash() [5/8]

ccf::crypto::Sha256Hash::Sha256Hash ( const Sha256Hash left,
const Sha256Hash right 
)

◆ Sha256Hash() [6/8]

ccf::crypto::Sha256Hash::Sha256Hash ( const Sha256Hash first,
const Sha256Hash second,
const Sha256Hash third 
)

◆ Sha256Hash() [7/8]

ccf::crypto::Sha256Hash::Sha256Hash ( const Sha256Hash hash)
default

◆ Sha256Hash() [8/8]

ccf::crypto::Sha256Hash::Sha256Hash ( Sha256Hash &&  hash)
inlinenoexcept

Member Function Documentation

◆ from_hex_string()

Sha256Hash ccf::crypto::Sha256Hash::from_hex_string ( const std::string &  str)
static

◆ from_representation()

Sha256Hash ccf::crypto::Sha256Hash::from_representation ( const Representation r)
static

◆ from_span()

Sha256Hash ccf::crypto::Sha256Hash::from_span ( const std::span< const uint8_t, SIZE > &  sp)
static

◆ hex_str()

std::string ccf::crypto::Sha256Hash::hex_str ( ) const

◆ operator=() [1/2]

Sha256Hash & ccf::crypto::Sha256Hash::operator= ( const Sha256Hash hash)
default

◆ operator=() [2/2]

Sha256Hash & ccf::crypto::Sha256Hash::operator= ( Sha256Hash &&  hash)
inlinenoexcept

◆ set()

void ccf::crypto::Sha256Hash::set ( const Representation r)
inline

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const ccf::crypto::Sha256Hash h 
)
friend

Member Data Documentation

◆ h

Representation ccf::crypto::Sha256Hash::h = {0}

◆ SIZE

constexpr size_t ccf::crypto::Sha256Hash::SIZE = 256 / 8
staticconstexpr

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