From 5838b0e8cedd44db81aad9be920aeead190cd70e Mon Sep 17 00:00:00 2001 From: Joseph Walton-Rivers <joseph@walton-rivers.uk> Date: Sat, 23 Jul 2022 13:43:01 +0100 Subject: [PATCH] comments for guids --- include/fggl/util/guid.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/fggl/util/guid.hpp b/include/fggl/util/guid.hpp index 9c92516..1c66d8d 100644 --- a/include/fggl/util/guid.hpp +++ b/include/fggl/util/guid.hpp @@ -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++) { -- GitLab