|
| | SHA1 () |
| | same as reset()
|
| std::string | operator() (const void *data, size_t numBytes) |
| | compute SHA1 of a memory block
|
| std::string | operator() (const std::string &text) |
| | compute SHA1 of a string, excluding final zero
|
| void | add (const void *data, size_t numBytes) |
| | add arbitrary number of bytes
|
| std::string | getHash () |
| | return latest hash as 40 hex characters
|
|
void | getHash (unsigned char buffer[HashBytes]) |
| | return latest hash as bytes
|
| void | reset () |
| | restart
|
compute SHA1 hash
Usage: SHA1 sha1; std::string myHash = sha1("Hello World"); // std::string std::string myHash2 = sha1("How are you", 11); // arbitrary data, 11 bytes
or in a streaming fashion:
SHA1 sha1;
while (more data available)
sha1.add(pointer to fresh data, number of new bytes);
std::string myHash3 = sha1.getHash();
Definition at line 41 of file sha1.h.