blace.ai
|
#include <types.h>
Public Member Functions | |
bool | operator== (const BlaceHash &rhs) const |
bool | operator!= (const BlaceHash &rhs) const |
long long | to_long_long () |
std::string | to_hex (int len=8) |
BlaceHash () | |
BlaceHash (int seed) | |
BlaceHash (std::string str) | |
BlaceHash (int64_t a, int64_t b, int64_t c, int64_t d) | |
std::string | print () |
Static Public Member Functions | |
static void | mix_string_into_hash (BlaceHash &hash, std::string str) |
static void | mix_float_into_hash (BlaceHash &hash, float data) |
Public Attributes | |
uint64_t | hash [4] |
Friends | |
std::ostream & | operator<< (std::ostream &os, const BlaceHash &obj) |
Struct to hold a hash.
blace::ml_core::BlaceHash::BlaceHash | ( | ) |
Default constructor.
blace::ml_core::BlaceHash::BlaceHash | ( | int | seed | ) |
Construct hash from a seed.
seed | The seed |
blace::ml_core::BlaceHash::BlaceHash | ( | std::string | str | ) |
Construct random from a string.
str | The string to create the hash from. |
blace::ml_core::BlaceHash::BlaceHash | ( | int64_t | a, |
int64_t | b, | ||
int64_t | c, | ||
int64_t | d | ||
) |
Construct from 4 values.
a | A |
b | B |
c | C |
d | D, who would have thought? |
|
static |
x
hash | x |
data | x |
|
static |
x
hash | x |
str | x |
bool blace::ml_core::BlaceHash::operator!= | ( | const BlaceHash & | rhs | ) | const |
Inequality operator.
rhs | The other hash. |
bool blace::ml_core::BlaceHash::operator== | ( | const BlaceHash & | rhs | ) | const |
Equality operator.
rhs | The other hash. |
|
inline |
Simple print helper.
std::string blace::ml_core::BlaceHash::to_hex | ( | int | len = 8 | ) |
Convert hash to a hexadecimal string.
len | Length of the string. |
long long blace::ml_core::BlaceHash::to_long_long | ( | ) |
Convert hash to a long long.
|
friend |
Print helper.
uint64_t blace::ml_core::BlaceHash::hash[4] |
The internal value store.