Contains common function related to hashing.
More...
#include <metrohash128/metrohash128.h>
#include <sha1/sha1.hpp>
#include <stdio.h>
#include <string>
Go to the source code of this file.
Contains common function related to hashing.
◆ hash_t
Definition for the standard 128-bit hash value in Jaffar.
◆ calculateMetroHash()
| __JAFFAR_COMMON__INLINE__ hash_t jaffarCommon::hash::calculateMetroHash |
( |
const void * |
data, |
|
|
size_t |
size |
|
) |
| |
Calculates the 128 bit Metrohash of a given buffer
- Parameters
-
| [in] | data | The input buffer to hash |
| [in] | size | The size of the buffer to hash |
- Returns
- The calculated 128-bit metro hash
◆ getSHA1String()
| __JAFFAR_COMMON__INLINE__ std::string jaffarCommon::hash::getSHA1String |
( |
const std::string & |
string | ) |
|
Calculates the SHA1 sum of a given input string and returns it as a stylized (string)
- Parameters
-
| [in] | string | The input string |
- Returns
- The SHA1 string of the input string
◆ hashString()
| __JAFFAR_COMMON__INLINE__ hash_t jaffarCommon::hash::hashString |
( |
const std::string & |
string | ) |
|
Calculates the 128-bit metro hash of a given string
- Parameters
-
| [in] | string | The string to calculate the hash for |
- Returns
- The hash value of the provided string
◆ hashToString()
| __JAFFAR_COMMON__INLINE__ std::string jaffarCommon::hash::hashToString |
( |
const hash_t |
hash | ) |
|
Produces an output string given a 128-bit hash
- Parameters
-
| [in] | hash | The hash value to stringify |
- Returns
- The string containing the stringified hash, formatted as upper case hexadecimal