Kemena3D
Loading...
Searching...
No Matches
kemena::kMD5 Class Reference

Streaming MD5 message-digest implementation. More...

#include <kmd5.h>

Public Member Functions

 kMD5 ()
 Constructs the context and initialises it to the MD5 starting state.
void update (const uint8_t *input, size_t length)
 Feeds a block of raw bytes into the running digest.
void update (const std::string &input)
 Feeds the contents of a string into the running digest.
std::string final ()
 Finalises the digest and returns it as a lowercase hex string.

Static Public Member Functions

static std::string hash (const std::string &input)
 One-shot helper that hashes an entire string.

Detailed Description

Streaming MD5 message-digest implementation.

Computes the 128-bit MD5 hash of arbitrary byte data following RFC 1321. Data may be fed incrementally through update() and the final hexadecimal digest retrieved with final(). For one-shot hashing of a string, use the static hash() convenience method.

Note
MD5 is cryptographically broken and should not be used for security purposes; it is provided for checksums and non-security identifiers.

Constructor & Destructor Documentation

◆ kMD5()

kemena::kMD5::kMD5 ( )
inline

Constructs the context and initialises it to the MD5 starting state.

Here is the caller graph for this function:

Member Function Documentation

◆ final()

std::string kemena::kMD5::final ( )
inline

Finalises the digest and returns it as a lowercase hex string.

Returns
The 32-character hexadecimal MD5 digest.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hash()

std::string kemena::kMD5::hash ( const std::string & input)
inlinestatic

One-shot helper that hashes an entire string.

Parameters
inputThe string to hash.
Returns
The 32-character hexadecimal MD5 digest of input.
Here is the call graph for this function:

◆ update() [1/2]

void kemena::kMD5::update ( const std::string & input)
inline

Feeds the contents of a string into the running digest.

Parameters
inputString whose bytes are appended to the message.
Here is the call graph for this function:

◆ update() [2/2]

void kemena::kMD5::update ( const uint8_t * input,
size_t length )
inline

Feeds a block of raw bytes into the running digest.

Parameters
inputPointer to the input bytes.
lengthNumber of bytes to process.
Here is the caller graph for this function:

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