Skip to content
Snippets Groups Projects
Commit 5838b0e8 authored by Joseph Walton-Rivers's avatar Joseph Walton-Rivers
Browse files

comments for guids

parent beff2fec
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,12 @@ namespace fggl::util {
constexpr uint64_t FNV_PRIME_64 = 0x00000100000001B3;
constexpr uint64_t FNV_OFFSET_BASIS_64 = 0xcbf29ce484222325;
/**
* Folwer-Noll-Vo 32-bit hash function.
*
* @param str the string to hash.
* @return the hashed value
*/
constexpr uint32_t hash_fnv1a_32(const char* str) {
uint32_t hash = FNV_OFFSET_BASIS_32;
for (int i = 0; str[i] != '\0'; i++) {
......@@ -40,6 +46,12 @@ namespace fggl::util {
return hash;
}
/**
* Folwer-Noll-Vo 64-bit hash function.
*
* @param str the string to be hashed
* @return the hashed value
*/
constexpr uint64_t hash_fnv1a_64(const char* str) {
uint64_t hash = FNV_OFFSET_BASIS_64;
for (int i = 0; str[i] != '\0'; i++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment