diff options
| author | Carson Fleming <[email protected]> | 2026-02-14 02:53:37 -0500 |
|---|---|---|
| committer | Carson Fleming <[email protected]> | 2026-02-14 02:53:37 -0500 |
| commit | 9ef0abf7ab5266f6b58c0e55bbe9dd9038bc7f6e (patch) | |
| tree | 54abfa548d7aae56c1ace1a72bce8581570b5fd2 /hash.c | |
| parent | 1a08245d480b8a18fcbc80efd8602cdb90d6ed5e (diff) | |
| download | safec-9ef0abf7ab5266f6b58c0e55bbe9dd9038bc7f6e.tar.gz | |
more like dangerousc.org atp
Diffstat (limited to 'hash.c')
| -rw-r--r-- | hash.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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; +} |
