SHA-1 hash function class. More...

#include <sha1.h>

Public Member Functions

virtual void add (const void *data, int size)=0
 Adds data to be hashed. More...
 
virtual void add (const DataBufferPtr &data)=0
 Add. More...
 
virtual void calculate ()=0
 Finalize hash calculation. More...
 
virtual std::string hash (bool uppercase=false) const =0
 Returns the calculated hash. More...
 
virtual void hash (unsigned char out_hash[hash_size]) const =0
 Get hash. More...
 
virtual void reset ()=0
 Resets the hash generator. More...
 
virtual void set_hmac (const void *key_data, int key_size)=0
 Enable a HMAC based calculation. More...
 

Static Public Member Functions

static std::shared_ptr< SHA1create ()
 Constructs a SHA-1 hash generator. More...
 

Static Public Attributes

static const int hash_size = 20
 

Detailed Description

SHA-1 hash function class.

Member Function Documentation

virtual void uicore::SHA1::add ( const void *  data,
int  size 
)
pure virtual

Adds data to be hashed.

virtual void uicore::SHA1::add ( const DataBufferPtr data)
pure virtual

Add.

Parameters
data= Data Buffer
virtual void uicore::SHA1::calculate ( )
pure virtual

Finalize hash calculation.

static std::shared_ptr<SHA1> uicore::SHA1::create ( )
static

Constructs a SHA-1 hash generator.

virtual std::string uicore::SHA1::hash ( bool  uppercase = false) const
pure virtual

Returns the calculated hash.

virtual void uicore::SHA1::hash ( unsigned char  out_hash[hash_size]) const
pure virtual

Get hash.

Parameters
out_hash= where to write to
virtual void uicore::SHA1::reset ( )
pure virtual

Resets the hash generator.

virtual void uicore::SHA1::set_hmac ( const void *  key_data,
int  key_size 
)
pure virtual

Enable a HMAC based calculation.

Call this function before the initial add(). It is reset by reset()

Parameters
key_data= The HMAC key
key_size= The size of the key_data

Member Data Documentation

const int uicore::SHA1::hash_size = 20
static

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