|
sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
|
compute Keccak hash (designated SHA3) More...
#include <keccak.h>
Public Types | |
| enum | Bits { Keccak224 = 224 , Keccak256 = 256 , Keccak384 = 384 , Keccak512 = 512 } |
| algorithm variants More... | |
Public Member Functions | |
| Keccak (Bits bits=Keccak256) | |
| 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 Keccak hash (designated SHA3)
Usage: Keccak keccak; std::string myHash = keccak("Hello World"); // std::string std::string myHash2 = keccak("How are you", 11); // arbitrary data, 11 bytes
or in a streaming fashion:
Keccak keccak; while (more data available) keccak.add(pointer to fresh data, number of new bytes); std::string myHash3 = keccak.getHash();
| enum Keccak::Bits |
|
explicit |
same as reset()
Definition at line 18 of file keccak.cpp.
| void Keccak::add | ( | const void * | data, |
| size_t | numBytes ) |
add arbitrary number of bytes
Definition at line 174 of file keccak.cpp.
| std::string Keccak::getHash | ( | ) |
return latest hash as hex characters
return latest hash as 16 hex characters
Definition at line 238 of file keccak.cpp.
| std::string Keccak::operator() | ( | const std::string & | text | ) |
compute hash of a string, excluding final zero
compute Keccak hash of a string, excluding final zero
Definition at line 295 of file keccak.cpp.
| std::string Keccak::operator() | ( | const void * | data, |
| size_t | numBytes ) |
compute hash of a memory block
compute Keccak hash of a memory block
Definition at line 286 of file keccak.cpp.
| void Keccak::reset | ( | ) |
restart
Definition at line 27 of file keccak.cpp.