class SHA1

A standard SHA1 digest calculator. More...

Full nameTelEngine::SHA1
Definition#include <yateclass.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Static Methods


Detailed Description

A class to compute and check SHA1 digests

 SHA1 ()

SHA1

Construct a fresh initialized instance

 SHA1 (const SHA1& original)

SHA1

Copy constructor

Parameters:
originalSHA1 instance to copy

 SHA1 (const void* buf, unsigned int len)

SHA1

Construct a digest from a buffer of data

Parameters:
bufPointer to the data to be included in digest
lenLength of data in the buffer

 SHA1 (const DataBlock& data)

SHA1

Construct a digest from a binary DataBlock

Parameters:
dataBinary data to be included in digest

 SHA1 (const String& str)

SHA1

Construct a digest from a String

Parameters:
strString to be included in digest

 ~SHA1 ()

~SHA1

Destroy the instance, free allocated memory

SHA1&  operator= (const SHA1& original)

operator=

Assignment operator.

void  clear ()

clear

Clear the digest and prepare for reuse

void  finalize ()

finalize

Finalize the digest computation, make result ready. Subsequent calls to update() will fail

bool  update (const void* buf, unsigned int len)

update

Update the digest from a buffer of data

Parameters:
bufPointer to the data to be included in digest
lenLength of data in the buffer

Returns: True if success, false if finalize() was already called

inline bool  update (const DataBlock& data)

update

Update the digest from the content of a DataBlock

Parameters:
dataData to be included in digest

Returns: True if success, false if finalize() was already called

inline bool  update (const String& str)

update

Update the digest from the content of a String

Parameters:
strString to be included in digest

Returns: True if success, false if finalize() was already called

inline SHA1&  operator<< (const String& value)

operator<<

SHA1 updating operator for Strings

inline SHA1&  operator<< (const DataBlock& data)

operator<<

SHA1 updating operator for DataBlocks

SHA1&  operator<< (const char* value)

operator<<

SHA1 updating operator for C strings

const unsigned char*  rawDigest ()

rawDigest

Returns a pointer to the raw 20-byte binary value of the message digest. The digest is finalized if if wasn't already

Returns: Pointer to the raw digest data or NULL if some error occured

inline unsigned int  rawLength ()

rawLength

[static]

Return the length of the raw binary digest

Returns: Constant value of 20

const String&  hexDigest ()

hexDigest

Returns the standard hexadecimal representation of the message digest. The digest is finalized if if wasn't already

Returns: A String which holds the hex digest or a null one if some error occured


Generated by: paulc on bussard on Fri Dec 21 16:28:34 2012, using kdoc 2.0a54.