tlx
|
SHA-256 processor without external dependencies. More...
#include <sha256.hpp>
Public Member Functions | |
SHA256 () | |
construct empty object. | |
SHA256 (const void *data, std::uint32_t size) | |
construct context and process data range | |
SHA256 (const std::string &str) | |
construct context and process string | |
void | process (const void *data, std::uint32_t size) |
process more data | |
void | process (const std::string &str) |
process more data | |
void | finalize (void *digest) |
finalize computation and output 32 byte (256 bit) digest | |
std::string | digest () |
finalize computation and return 32 byte (256 bit) digest | |
std::string | digest_hex () |
finalize computation and return 32 byte (256 bit) digest hex encoded | |
std::string | digest_hex_uc () |
finalize computation and return 32 byte (256 bit) digest upper-case hex | |
Static Public Attributes | |
static constexpr size_t | kDigestLength |
digest length in bytes | |
Private Attributes | |
std::uint64_t | length_ |
std::uint32_t | state_ [8] |
std::uint32_t | curlen_ |
std::uint8_t | buf_ [64] |
SHA-256 processor without external dependencies.
Definition at line 28 of file sha256.hpp.
SHA256 | ( | ) |
construct empty object.
Definition at line 132 of file sha256.cpp.
SHA256 | ( | const void * | data, |
std::uint32_t | size ) |
construct context and process data range
Definition at line 145 of file sha256.cpp.
|
explicit |
construct context and process string
Definition at line 150 of file sha256.cpp.
std::string digest | ( | ) |
finalize computation and return 32 byte (256 bit) digest
Definition at line 221 of file sha256.cpp.
std::string digest_hex | ( | ) |
finalize computation and return 32 byte (256 bit) digest hex encoded
Definition at line 227 of file sha256.cpp.
std::string digest_hex_uc | ( | ) |
finalize computation and return 32 byte (256 bit) digest upper-case hex
Definition at line 233 of file sha256.cpp.
void finalize | ( | void * | digest | ) |
finalize computation and output 32 byte (256 bit) digest
Definition at line 190 of file sha256.cpp.
void process | ( | const std::string & | str | ) |
process more data
Definition at line 186 of file sha256.cpp.
void process | ( | const void * | data, |
std::uint32_t | size ) |
process more data
Definition at line 155 of file sha256.cpp.
|
private |
Definition at line 60 of file sha256.hpp.
|
private |
Definition at line 59 of file sha256.hpp.
|
staticconstexpr |
digest length in bytes
Definition at line 44 of file sha256.hpp.
|
private |
Definition at line 57 of file sha256.hpp.
|
private |
Definition at line 58 of file sha256.hpp.