From bac14fa6c79b6abea50fd5f188799ae8e83cb20d Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 5 Sep 2024 16:23:05 -0400 Subject: Fully clean up siphash code and fix some issues --- builtins/c_string.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'builtins/c_string.c') 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 #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 = { -- cgit v1.2.3