SHA-1 hash function class. More...
#include <sha1.h>
Public Member Functions | |
| SHA1 () | |
| Constructs a SHA-1 hash generator. More... | |
| void | add (const DataBuffer &data) |
| Add. More... | |
| void | add (const void *data, int size) |
| Adds data to be hashed. More... | |
| void | calculate () |
| Finalize hash calculation. More... | |
| std::string | get_hash (bool uppercase=false) const |
| Returns the calculated hash. More... | |
| void | get_hash (unsigned char out_hash[hash_size]) const |
| Get hash. More... | |
| void | reset () |
| Resets the hash generator. More... | |
| void | set_hmac (const void *key_data, int key_size) |
| Enable a HMAC based calculation. More... | |
Static Public Attributes | |
| static const int | hash_size = 20 |
SHA-1 hash function class.
| clan::SHA1::SHA1 | ( | ) |
Constructs a SHA-1 hash generator.
| void clan::SHA1::add | ( | const DataBuffer & | data | ) |
Add.
| data | = Data Buffer |
| void clan::SHA1::add | ( | const void * | data, |
| int | size | ||
| ) |
Adds data to be hashed.
| void clan::SHA1::calculate | ( | ) |
Finalize hash calculation.
| std::string clan::SHA1::get_hash | ( | bool | uppercase = false | ) | const |
Returns the calculated hash.
| void clan::SHA1::get_hash | ( | unsigned char | out_hash[hash_size] | ) | const |
Get hash.
| out_hash | = where to write to |
| void clan::SHA1::reset | ( | ) |
Resets the hash generator.
| void clan::SHA1::set_hmac | ( | const void * | key_data, |
| int | key_size | ||
| ) |
|
static |