NimbRo ROS Soccer Package
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
hash_lib::Keccak Class Reference

compute Keccak hash (designated SHA3) More...

#include <keccak.h>

Public Types

enum  Bits { Keccak224 = 224, Keccak256 = 256, Keccak384 = 384, Keccak512 = 512 }
 algorithm variants
 

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 More...
 
std::string operator() (const std::string &text)
 compute hash of a string, excluding final zero More...
 
void add (const void *data, size_t numBytes)
 add arbitrary number of bytes
 
std::string getHash ()
 return latest hash as hex characters More...
 
void reset ()
 restart
 

Detailed Description

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();

Member Function Documentation

std::string hash_lib::Keccak::getHash ( )

return latest hash as hex characters

return latest hash as 16 hex characters

std::string hash_lib::Keccak::operator() ( const void *  data,
size_t  numBytes 
)

compute hash of a memory block

compute Keccak hash of a memory block

std::string hash_lib::Keccak::operator() ( const std::string &  text)

compute hash of a string, excluding final zero

compute Keccak hash of a string, excluding final zero


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