From 9ef0abf7ab5266f6b58c0e55bbe9dd9038bc7f6e Mon Sep 17 00:00:00 2001 From: Carson Fleming Date: Sat, 14 Feb 2026 02:53:37 -0500 Subject: more like dangerousc.org atp --- hash.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 hash.c (limited to 'hash.c') diff --git a/hash.c b/hash.c new file mode 100644 index 0000000..6201275 --- /dev/null +++ b/hash.c @@ -0,0 +1,10 @@ +#include "hash.h" + +size_t hash_bytes(const void* start, size_t size) { + size_t hash = 0; + const char* raw_data = start; + for (size_t i = 0; i < size; i++) { + hash = (hash << 5) - hash + raw_data[i]; + } + return hash; +} -- cgit v1.2.3