diff --git a/include/fggl/util/guid.hpp b/include/fggl/util/guid.hpp index 9c92516fd92d08490826ed388c4192710fa29a77..1c66d8d6e6228a51d2f0b2eaf89809271ea9096a 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++) {