MD5 message-digest.
More...
#include <base/security/MD5Sum.h>
Inherits Object, and PushInterface.
MD5 message-digest.
Implementation of the MD5 message-digest algorithm (see RFC 1321). This class takes a message of arbitrary length and produces a 128-bit "fingerprint"/"message digest" of the message. According to the RFC it is computationally infeasible to produce two messages having the same message digest, or to produce any message having a given prespecified target message digest.
String message =
"abcdefghijklmnopqrstuvwxyz";
fout <<
"message digest: " << checksum.
getValue() << ENDL;
- See also
- SHA1
- Version
- 1.0
- Examples
- testsuite/digest.cpp.
◆ MD5Sum()
◆ getBase64()
String MD5Sum::getBase64 |
( |
| ) |
const |
|
noexcept |
Returns the message digest encoded in Base64. This is only valid after pushEnd() has been invoked.
◆ getTotalSize()
uint64 MD5Sum::getTotalSize |
( |
| ) |
const |
|
inlinenoexcept |
Returns the total size of the original message.
◆ getValue()
String MD5Sum::getValue |
( |
| ) |
const |
|
noexcept |
◆ push()
MemorySize MD5Sum::push |
( |
const uint8 * |
buffer, |
|
|
MemorySize |
size |
|
) |
| |
|
virtual |
Updates the checksum corresponding to the specified data. May be called multiple times. Raises OutOfRange if the total number of octets exceed the limit specified by MAXIMUM_SIZE.
- Parameters
-
buffer | The buffer holding the data. |
size | The number of octets in the buffer. |
Implements PushInterface.
- Examples
- testsuite/digest.cpp.
◆ pushEnd()
◆ BLOCK_SIZE
const unsigned int MD5Sum::BLOCK_SIZE = 64 |
|
static |
Internal block size in bytes.
◆ MAXIMUM_SIZE
const uint64 MD5Sum::MAXIMUM_SIZE = (1ULL << (64 - 3)) - 1 |
|
static |
Specifies the maximum length (in bytes) of the original message.