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 (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)
 
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/6]

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

◆ Sha256Hash() [2/6]

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

◆ Sha256Hash() [3/6]

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

◆ Sha256Hash() [4/6]

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

◆ Sha256Hash() [5/6]

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

◆ Sha256Hash() [6/6]

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

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

◆ set()

void ccf::crypto::Sha256Hash::set ( 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: