Streaming MD5 message-digest implementation.
More...
#include <kmd5.h>
|
| | 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 std::string | hash (const std::string &input) |
| | One-shot helper that hashes an entire string.
|
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.
◆ kMD5()
Constructs the context and initialises it to the MD5 starting state.
◆ 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.
◆ hash()
| std::string kemena::kMD5::hash |
( |
const std::string & | input | ) |
|
|
inlinestatic |
One-shot helper that hashes an entire string.
- Parameters
-
- Returns
- The 32-character hexadecimal MD5 digest of
input.
◆ update() [1/2]
| void kemena::kMD5::update |
( |
const std::string & | input | ) |
|
|
inline |
Feeds the contents of a string into the running digest.
- Parameters
-
| input | String whose bytes are appended to the message. |
◆ 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
-
| input | Pointer to the input bytes. |
| length | Number of bytes to process. |
The documentation for this class was generated from the following file: