diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-05 16:23:05 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-05 16:23:05 -0400 |
| commit | bac14fa6c79b6abea50fd5f188799ae8e83cb20d (patch) | |
| tree | 416a7b9ff39075ab33fb93ab4e86003df4d25aca /builtins/c_string.c | |
| parent | 47e8972427c152891c4c6c4b458f78cd7ceb8aee (diff) | |
Fully clean up siphash code and fix some issues
Diffstat (limited to 'builtins/c_string.c')
| -rw-r--r-- | builtins/c_string.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/builtins/c_string.c b/builtins/c_string.c index b0c70f0a..d916bfa9 100644 --- a/builtins/c_string.c +++ b/builtins/c_string.c @@ -8,8 +8,8 @@ #include <stdlib.h> #include "functions.h" -#include "halfsiphash.h" #include "text.h" +#include "siphash.h" #include "types.h" #include "util.h" @@ -37,13 +37,10 @@ public bool CString$equal(const char **x, const char **y) return CString$compare(x, y) == 0; } -public uint32_t CString$hash(const char **c_str) +public uint64_t CString$hash(const char **c_str) { if (!*c_str) return 0; - - uint32_t hash; - halfsiphash(*c_str, strlen(*c_str), TOMO_HASH_KEY, (uint8_t*)&hash, sizeof(hash)); - return hash; + return siphash24((void*)*c_str, strlen(*c_str)); } public const TypeInfo CString$info = { |
