tlx
Loading...
Searching...
No Matches

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

#include <md5.hpp>

Public Member Functions

 MD5 ()
 construct empty object.
 
 MD5 (const void *data, std::uint32_t size)
 construct context and process data range
 
 MD5 (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 16 byte (128 bit) digest
 
std::string digest ()
 finalize computation and return 16 byte (128 bit) digest
 
std::string digest_hex ()
 finalize computation and return 16 byte (128 bit) digest hex encoded
 
std::string digest_hex_uc ()
 finalize computation and return 16 byte (128 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_ [4]
 
std::uint32_t curlen_
 
std::uint8_t buf_ [64]
 

Detailed Description

MD-5 processor without external dependencies.

Definition at line 28 of file md5.hpp.

Constructor & Destructor Documentation

◆ MD5() [1/3]

MD5 ( )

construct empty object.

Definition at line 167 of file md5.cpp.

◆ MD5() [2/3]

MD5 ( const void *  data,
std::uint32_t  size 
)

construct context and process data range

Definition at line 176 of file md5.cpp.

◆ MD5() [3/3]

MD5 ( const std::string &  str)
explicit

construct context and process string

Definition at line 180 of file md5.cpp.

Member Function Documentation

◆ digest()

std::string digest ( )

finalize computation and return 16 byte (128 bit) digest

Definition at line 254 of file md5.cpp.

◆ digest_hex()

std::string digest_hex ( )

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

Definition at line 260 of file md5.cpp.

◆ digest_hex_uc()

std::string digest_hex_uc ( )

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

Definition at line 266 of file md5.cpp.

◆ finalize()

void finalize ( void *  digest)

finalize computation and output 16 byte (128 bit) digest

Definition at line 222 of file md5.cpp.

◆ process() [1/2]

void process ( const std::string &  str)

process more data

Definition at line 218 of file md5.cpp.

◆ process() [2/2]

void process ( const void *  data,
std::uint32_t  size 
)

process more data

Definition at line 184 of file md5.cpp.

Member Data Documentation

◆ buf_

std::uint8_t buf_[64]
private

Definition at line 60 of file md5.hpp.

◆ curlen_

std::uint32_t curlen_
private

Definition at line 59 of file md5.hpp.

◆ kDigestLength

constexpr size_t kDigestLength
staticconstexpr

digest length in bytes

Definition at line 44 of file md5.hpp.

◆ length_

std::uint64_t length_
private

Definition at line 57 of file md5.hpp.

◆ state_

std::uint32_t state_[4]
private

Definition at line 58 of file md5.hpp.


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