Thrill  0.1

Detailed Description

MD-5 processor without external dependencies.

Definition at line 28 of file md5.hpp.

#include <md5.hpp>

Public Member Functions

 MD5 ()
 construct empty object. More...
 
 MD5 (const void *data, uint32_t size)
 construct context and process data range More...
 
 MD5 (const std::string &str)
 construct context and process string More...
 
std::string digest ()
 finalize computation and return 16 byte (128 bit) digest More...
 
std::string digest_hex ()
 finalize computation and return 16 byte (128 bit) digest hex encoded More...
 
std::string digest_hex_uc ()
 finalize computation and return 16 byte (128 bit) digest upper-case hex More...
 
void finalize (void *digest)
 finalize computation and output 16 byte (128 bit) digest More...
 
void process (const void *data, uint32_t size)
 process more data More...
 
void process (const std::string &str)
 process more data More...
 

Static Public Attributes

static constexpr size_t kDigestLength = 16
 digest length in bytes More...
 

Private Attributes

uint8_t buf_ [64]
 
uint32_t curlen_
 
uint64_t length_
 
uint32_t state_ [4]
 

Constructor & Destructor Documentation

◆ MD5() [1/3]

MD5 ( )

construct empty object.

Definition at line 166 of file md5.cpp.

Referenced by tlx::md5_hex(), and tlx::md5_hex_uc().

◆ MD5() [2/3]

MD5 ( const void *  data,
uint32_t  size 
)

construct context and process data range

Definition at line 175 of file md5.cpp.

References MD5::process().

◆ MD5() [3/3]

MD5 ( const std::string &  str)
explicit

construct context and process string

Definition at line 179 of file md5.cpp.

References MD5::process().

Member Function Documentation

◆ digest()

std::string digest ( )

finalize computation and return 16 byte (128 bit) digest

Definition at line 253 of file md5.cpp.

References MD5::finalize(), and MD5::kDigestLength.

Referenced by MD5::digest_hex(), and MD5::digest_hex_uc().

◆ digest_hex()

std::string digest_hex ( )

finalize computation and return 16 byte (128 bit) digest hex encoded

Definition at line 259 of file md5.cpp.

References MD5::digest(), MD5::finalize(), tlx::hexdump_lc(), and MD5::kDigestLength.

◆ digest_hex_uc()

std::string digest_hex_uc ( )

finalize computation and return 16 byte (128 bit) digest upper-case hex

Definition at line 265 of file md5.cpp.

References MD5::digest(), MD5::finalize(), tlx::hexdump(), and MD5::kDigestLength.

◆ finalize()

void finalize ( void *  digest)

finalize computation and output 16 byte (128 bit) digest

Definition at line 221 of file md5.cpp.

References MD5::buf_, MD5::curlen_, MD5::length_, tlx::digest_detail::md5_compress(), MD5::state_, tlx::digest_detail::store32l(), and tlx::digest_detail::store64l().

Referenced by MD5::digest(), MD5::digest_hex(), and MD5::digest_hex_uc().

◆ process() [1/2]

void process ( const void *  data,
uint32_t  size 
)

process more data

Definition at line 183 of file md5.cpp.

References MD5::buf_, MD5::curlen_, MD5::length_, tlx::digest_detail::md5_compress(), tlx::digest_detail::min(), and MD5::state_.

Referenced by MD5::MD5(), and MD5::process().

◆ process() [2/2]

void process ( const std::string &  str)

process more data

Definition at line 217 of file md5.cpp.

References MD5::process().

Member Data Documentation

◆ buf_

uint8_t buf_[64]
private

Definition at line 60 of file md5.hpp.

Referenced by MD5::finalize(), and MD5::process().

◆ curlen_

uint32_t curlen_
private

Definition at line 59 of file md5.hpp.

Referenced by MD5::finalize(), and MD5::process().

◆ kDigestLength

constexpr size_t kDigestLength = 16
static

digest length in bytes

Definition at line 44 of file md5.hpp.

Referenced by MD5::digest(), MD5::digest_hex(), and MD5::digest_hex_uc().

◆ length_

uint64_t length_
private

Definition at line 57 of file md5.hpp.

Referenced by MD5::finalize(), and MD5::process().

◆ state_

uint32_t state_[4]
private

Definition at line 58 of file md5.hpp.

Referenced by MD5::finalize(), and MD5::process().


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