|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
#include <sha3.h>
Public Types | |
| enum | Bits { Bits224 = 224 , Bits256 = 256 , Bits384 = 384 , Bits512 = 512 } |
| algorithm variants More... | |
Public Member Functions | |
| SHA3 (Bits bits=Bits256) | |
| same as reset() | |
| std::string | operator() (const void *data, size_t numBytes) |
| compute hash of a memory block | |
| std::string | operator() (const std::string &text) |
| compute hash 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 hex characters | |
| void | reset () |
| restart | |
compute SHA3 hash
Usage: SHA3 sha3; std::string myHash = sha3("Hello World"); // std::string std::string myHash2 = sha3("How are you", 11); // arbitrary data, 11 bytes
or in a streaming fashion:
SHA3 sha3; while (more data available) sha3.add(pointer to fresh data, number of new bytes); std::string myHash3 = sha3.getHash();
| enum hash::SHA3::Bits |
| void hash::SHA3::add | ( | const void * | data, |
| size_t | numBytes ) |
add arbitrary number of bytes
Definition at line 181 of file sha3.cpp.
Referenced by operator()(), and operator()().
| std::string hash::SHA3::getHash | ( | ) |
return latest hash as hex characters
return latest hash as 16 hex characters
Definition at line 244 of file sha3.cpp.
Referenced by operator()(), and operator()().
| std::string hash::SHA3::operator() | ( | const std::string & | text | ) |
| std::string hash::SHA3::operator() | ( | const void * | data, |
| size_t | numBytes ) |
| void hash::SHA3::reset | ( | ) |
restart
Definition at line 34 of file sha3.cpp.
Referenced by operator()(), operator()(), and SHA3().