Sirikata
Public Member Functions | Private Member Functions | Private Attributes
Sirikata::SHA256Context Class Reference

Class to allow creating a shasum from sparse data and other types. More...

#include <Sha256.hpp>

Collaboration diagram for Sirikata::SHA256Context:

List of all members.

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 SHA256get ()
 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.
SHA256Contextoperator= (const SHA256Context &other)

Private Attributes

void * mCtx
 Opaque reference to SHA256_CTX.
SHA256 mRetval
 Stores the result after the context has been freed.

Detailed Description

Class to allow creating a shasum from sparse data and other types.


Constructor & Destructor Documentation

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.


Member Function Documentation

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 
)
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().


Member Data Documentation

Opaque reference to SHA256_CTX.

Stores the result after the context has been freed.

Allows return by reference.


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