tlx

MD-5 processor without external dependencies. More...

#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...
 
void process (const void *data, uint32_t size)
 process more data More...
 
void process (const std::string &str)
 process more data More...
 
void finalize (void *digest)
 finalize computation and output 16 byte (128 bit) digest 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...
 

Static Public Attributes

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

Private Attributes

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

Detailed Description

MD-5 processor without external dependencies.

Definition at line 28 of file md5.hpp.

Constructor & Destructor Documentation

MD5 ( )

construct empty object.

Definition at line 166 of file md5.cpp.

MD5 ( const void *  data,
uint32_t  size 
)

construct context and process data range

Definition at line 175 of file md5.cpp.

MD5 ( const std::string &  str)
explicit

construct context and process string

Definition at line 179 of file md5.cpp.

Member Function Documentation

std::string digest ( )

finalize computation and return 16 byte (128 bit) digest

Definition at line 253 of file md5.cpp.

std::string digest_hex ( )

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

Definition at line 259 of file md5.cpp.

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.

void finalize ( void *  digest)

finalize computation and output 16 byte (128 bit) digest

Definition at line 221 of file md5.cpp.

void process ( const void *  data,
uint32_t  size 
)

process more data

Definition at line 183 of file md5.cpp.

void process ( const std::string &  str)

process more data

Definition at line 217 of file md5.cpp.

Member Data Documentation

uint8_t buf_[64]
private

Definition at line 60 of file md5.hpp.

uint32_t curlen_
private

Definition at line 59 of file md5.hpp.

constexpr size_t kDigestLength
static

digest length in bytes

Definition at line 44 of file md5.hpp.

uint64_t length_
private

Definition at line 57 of file md5.hpp.

uint32_t state_[4]
private

Definition at line 58 of file md5.hpp.


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