![]() |
Public API Reference |
![]() |
Compute a SHA-256 message digest. More...
#include <csutil/sha256.h>
Public Types | |
typedef CS::Utility::Checksum::Digest< 32 > | Digest |
A SHA256 digest is 32 unsigned characters (not 0-terminated). | |
Public Member Functions | |
void | Append (const uint8 *input, size_t length) |
Used to update the the input data hash. | |
Digest | Finish () |
Used to complete the hashing process and obtain the calculated hash. | |
Static Public Member Functions | |
static Digest | Encode (csString const &) |
Encode a string. | |
static Digest | Encode (const char *) |
Encode a null-terminated string buffer. | |
static Digest | Encode (const void *, size_t nbytes) |
Encode a buffer. |
Compute a SHA-256 message digest.
This class provides an interface to compute a digest in a "streaming" manner (the message can be split into chunks which are processed sequentially) as well as a convenient interface which allows one to create a digest in a single step.
void CS::Utility::Checksum::SHA256::Append | ( | const uint8 * | input, |
size_t | length | ||
) |
Used to update the the input data hash.
input | A pointer to an array of the input data with which to update the hash. |
length | The length of the input data to hash (in bytes). |
static Digest CS::Utility::Checksum::SHA256::Encode | ( | csString const & | ) | [static] |
Encode a string.
static Digest CS::Utility::Checksum::SHA256::Encode | ( | const char * | ) | [static] |
Encode a null-terminated string buffer.
static Digest CS::Utility::Checksum::SHA256::Encode | ( | const void * | , |
size_t | nbytes | ||
) | [static] |
Encode a buffer.
Digest CS::Utility::Checksum::SHA256::Finish | ( | ) |
Used to complete the hashing process and obtain the calculated hash.
After finishing, don't append further data to the hash -- the resulting digest will be bogus.