Joedb 10.5.0
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
joedb::SHA_256 Class Reference

Compute SHA 256 hash code: https://en.wikipedia.org/wiki/SHA-2. More...

#include <joedb/journal/SHA_256.h>

Public Types

using Hash = std::array<uint32_t, 8>

Public Member Functions

 SHA_256 ()
const Hash & get_hash () const
void process_chunk (const char *data)
 process 512 bits (32 * 16, 8 * 64) of data, SHA_256::chunk_size bytes
void process_final_chunk (const char *const data, const uint64_t total_length_in_bytes)
 process last bytes of the sequence

Static Public Attributes

static constexpr size_t chunk_size = 64

Detailed Description

Definition at line 19 of file SHA_256.h.

Member Typedef Documentation

◆ Hash

using joedb::SHA_256::Hash = std::array<uint32_t, 8>

Definition at line 59 of file SHA_256.h.

Constructor & Destructor Documentation

◆ SHA_256()

joedb::SHA_256::SHA_256 ( )
inline

Definition at line 65 of file SHA_256.h.

Member Function Documentation

◆ get_hash()

const Hash & joedb::SHA_256::get_hash ( ) const
inline

Definition at line 66 of file SHA_256.h.

◆ process_chunk()

void joedb::SHA_256::process_chunk ( const char * data)
inline

Definition at line 70 of file SHA_256.h.

◆ process_final_chunk()

void joedb::SHA_256::process_final_chunk ( const char *const data,
const uint64_t total_length_in_bytes )
inline
Parameters
datapoints to the final n bytes, 0 <= n < 64
total_length_in_bytesis the length of the whole sequence

Definition at line 124 of file SHA_256.h.

Member Data Documentation

◆ chunk_size

size_t joedb::SHA_256::chunk_size = 64
staticconstexpr

Definition at line 67 of file SHA_256.h.


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