Sirikata
|
Class to allow creating a shasum from sparse data and other types. More...
#include <Sha256.hpp>
Public Member Functions | |
SHA256Context () | |
Constructs a new context with no data. | |
~SHA256Context () | |
Destroys context only if not already cast to SHA256. | |
void | update (const void *data, size_t length) |
Insert data. | |
void | update (const std::string &data) |
Insert std::string data; same as update(data(),length()) | |
void | updateZeros (size_t length) |
Insert zero data -- special case to make SparseData easier to handle. | |
const SHA256 & | get () |
Returns a SHA256 sum from the updated data. Cannot update after this. | |
Private Member Functions | |
SHA256Context (const SHA256Context &other) | |
Do not allow copying because no function exists to copy SHA256_CTX. | |
SHA256Context & | operator= (const SHA256Context &other) |
Private Attributes | |
void * | mCtx |
Opaque reference to SHA256_CTX. | |
SHA256 | mRetval |
Stores the result after the context has been freed. |
Class to allow creating a shasum from sparse data and other types.
Sirikata::SHA256Context::SHA256Context | ( | const SHA256Context & | other | ) | [private] |
Do not allow copying because no function exists to copy SHA256_CTX.
Sirikata::SHA256Context::SHA256Context | ( | ) |
Constructs a new context with no data.
Sirikata::SHA256Context::~SHA256Context | ( | ) |
Destroys context only if not already cast to SHA256.
const SHA256 & Sirikata::SHA256Context::get | ( | ) |
Returns a SHA256 sum from the updated data. Cannot update after this.
Referenced by Sirikata::Transfer::SparseData::computeFingerprint().
SHA256Context& Sirikata::SHA256Context::operator= | ( | const SHA256Context & | other | ) | [private] |
void Sirikata::SHA256Context::update | ( | const void * | data, |
size_t | length | ||
) |
Insert data.
Referenced by Sirikata::Transfer::SparseData::computeFingerprint().
void Sirikata::SHA256Context::update | ( | const std::string & | data | ) | [inline] |
Insert std::string data; same as update(data(),length())
void Sirikata::SHA256Context::updateZeros | ( | size_t | length | ) |
Insert zero data -- special case to make SparseData easier to handle.
Referenced by Sirikata::Transfer::SparseData::computeFingerprint().
void* Sirikata::SHA256Context::mCtx [private] |
Opaque reference to SHA256_CTX.
SHA256 Sirikata::SHA256Context::mRetval [private] |
Stores the result after the context has been freed.
Allows return by reference.