gloox  1.1-svn
Public Member Functions | Static Public Member Functions | List of all members
SHA Class Reference

#include <sha.h>

Public Member Functions

 SHA ()
virtual ~SHA ()
void reset ()
void finalize ()
const std::string hex ()
const std::string binary ()
void feed (const unsigned char *data, unsigned length)
void feed (const std::string &data)

Static Public Member Functions

static const std::string sha1 (const std::string &data)

Detailed Description

An implementation of SHA1.

Author
Jakob Schroeter js@ca.nosp@m.maya.nosp@m..net
Since
0.9

Definition at line 29 of file sha.h.

Constructor & Destructor Documentation

SHA ( )

Constructs a new SHA object.

Definition at line 30 of file sha.cpp.

~SHA ( )
virtual

Virtual Destructor.

Definition at line 35 of file sha.cpp.

Member Function Documentation

const std::string binary ( )

Returns the raw binary message digest. Finalizes the hash if finalize() has not been called before.

Returns
The message raw binary digest.

Definition at line 74 of file sha.cpp.

void feed ( const unsigned char *  data,
unsigned  length 
)

Provide input to SHA1.

Parameters
dataThe data to compute the digest of.
lengthThe size of the data in bytes.

Definition at line 95 of file sha.cpp.

void feed ( const std::string &  data)

Provide input to SHA1.

Parameters
dataThe data to compute the digest of.

Definition at line 131 of file sha.cpp.

void finalize ( )

Finalizes the hash computation.

Definition at line 86 of file sha.cpp.

const std::string hex ( )

Returns the message digest in hex notation. Finalizes the hash if finalize() has not been called before.

Returns
The message digest.

Definition at line 60 of file sha.cpp.

void reset ( )

Resets the internal state.

Definition at line 55 of file sha.cpp.

const std::string sha1 ( const std::string &  data)
static

Static function that returns a hash of the given data.

Parameters
dataInput data to hash.
Returns
The data's hash in hex notation.

Definition at line 23 of file sha.cpp.


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