Hash function for data sequences.
More...
#include <hash.hpp>
|
| HashFunction () |
| Default constructor: initialize the hash function. More...
|
|
| ~HashFunction () |
| Destructor. More...
|
|
HashFunction & | AppendBytes (const void *seq, size_t num_bytes) |
| Add a sequence of bytes for hashing. More...
|
|
template<typename int_type > |
HashFunction & | AppendInts (const int_type *ints, size_t num_ints) |
| Add a sequence of integers for hashing, given as a c-array. More...
|
|
template<typename int_type , size_t num_ints> |
HashFunction & | AppendInts (const int_type(&ints)[num_ints]) |
| Add a sequence of integers for hashing, given as a fixed-size c-array. More...
|
|
template<typename int_type_container > |
HashFunction & | AppendInts (const int_type_container &ints) |
| Add a sequence of integers for hashing, given as a container. More...
|
|
HashFunction & | AppendDoubles (const double *doubles, size_t num_doubles) |
| Add a sequence of doubles for hashing, given as a c-array. More...
|
|
template<size_t num_doubles> |
HashFunction & | AppendDoubles (const double(&doubles)[num_doubles]) |
| Add a sequence of doubles for hashing, given as a fixed-size c-array. More...
|
|
template<typename double_container > |
HashFunction & | AppendDoubles (const double_container &doubles) |
| Add a sequence of doubles for hashing, given as a container. More...
|
|
std::string | GetHash () const |
| Return the hash string for the current sequence and reset (clear) the sequence. More...
|
|
|
void | HashBuffer (const void *buffer, size_t num_bytes) |
| Add a sequence of bytes for hashing. More...
|
|
template<typename int_type_const_iter > |
HashFunction & | EncodeAndHashInts (int_type_const_iter begin, int_type_const_iter end) |
| Integer encoding method; result is independent of endianness and type. More...
|
|
template<typename double_const_iter > |
HashFunction & | EncodeAndHashDoubles (double_const_iter begin, double_const_iter end) |
| Double encoding method: encode in little-endian byte-order. More...
|
|
Hash function for data sequences.
Depends on GnuTLS for SHA-256 hashing.
Definition at line 218 of file hash.hpp.
mfem::HashFunction::HashFunction |
( |
| ) |
|
Default constructor: initialize the hash function.
Definition at line 29 of file hash.cpp.
mfem::HashFunction::~HashFunction |
( |
| ) |
|
Destructor.
Definition at line 38 of file hash.cpp.
HashFunction& mfem::HashFunction::AppendBytes |
( |
const void * |
seq, |
|
|
size_t |
num_bytes |
|
) |
| |
|
inline |
Add a sequence of bytes for hashing.
Definition at line 244 of file hash.hpp.
HashFunction& mfem::HashFunction::AppendDoubles |
( |
const double * |
doubles, |
|
|
size_t |
num_doubles |
|
) |
| |
|
inline |
Add a sequence of doubles for hashing, given as a c-array.
Before hashing the sequence is encoded so that the result is independent of endianness.
Definition at line 271 of file hash.hpp.
template<size_t num_doubles>
HashFunction& mfem::HashFunction::AppendDoubles |
( |
const double(&) |
doubles[num_doubles] | ) |
|
|
inline |
Add a sequence of doubles for hashing, given as a fixed-size c-array.
Before hashing the sequence is encoded so that the result is independent of endianness.
Definition at line 278 of file hash.hpp.
template<typename double_container >
HashFunction& mfem::HashFunction::AppendDoubles |
( |
const double_container & |
doubles | ) |
|
|
inline |
Add a sequence of doubles for hashing, given as a container.
Before hashing the sequence is encoded so that the result is independent of endianness.
Definition at line 285 of file hash.hpp.
template<typename int_type >
HashFunction& mfem::HashFunction::AppendInts |
( |
const int_type * |
ints, |
|
|
size_t |
num_ints |
|
) |
| |
|
inline |
Add a sequence of integers for hashing, given as a c-array.
Before hashing the sequence is encoded so that the result is independent of endianness and type: int, long, unsigned, etc.
Definition at line 251 of file hash.hpp.
template<typename int_type , size_t num_ints>
HashFunction& mfem::HashFunction::AppendInts |
( |
const int_type(&) |
ints[num_ints] | ) |
|
|
inline |
Add a sequence of integers for hashing, given as a fixed-size c-array.
Before hashing the sequence is encoded so that the result is independent of endianness and type: int, long, unsigned, etc.
Definition at line 258 of file hash.hpp.
template<typename int_type_container >
HashFunction& mfem::HashFunction::AppendInts |
( |
const int_type_container & |
ints | ) |
|
|
inline |
Add a sequence of integers for hashing, given as a container.
Before hashing the sequence is encoded so that the result is independent of endianness and type: int, long, unsigned, etc.
Definition at line 265 of file hash.hpp.
template<typename double_const_iter >
HashFunction & mfem::HashFunction::EncodeAndHashDoubles |
( |
double_const_iter |
begin, |
|
|
double_const_iter |
end |
|
) |
| |
|
protected |
Double encoding method: encode in little-endian byte-order.
Definition at line 704 of file hash.hpp.
template<typename int_type_const_iter >
HashFunction & mfem::HashFunction::EncodeAndHashInts |
( |
int_type_const_iter |
begin, |
|
|
int_type_const_iter |
end |
|
) |
| |
|
protected |
Integer encoding method; result is independent of endianness and type.
Definition at line 654 of file hash.hpp.
std::string mfem::HashFunction::GetHash |
( |
| ) |
const |
Return the hash string for the current sequence and reset (clear) the sequence.
Definition at line 60 of file hash.cpp.
void mfem::HashFunction::HashBuffer |
( |
const void * |
buffer, |
|
|
size_t |
num_bytes |
|
) |
| |
|
protected |
Add a sequence of bytes for hashing.
Definition at line 45 of file hash.cpp.
void* mfem::HashFunction::hash_data |
|
protected |
The documentation for this class was generated from the following files: