first commit

This commit is contained in:
cozis
2021-10-31 04:17:57 +00:00
commit 7a5d0d1dcb
55 changed files with 5204 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#include <stdint.h>
#include "hash.h"
int hashbytes(unsigned char *str, int len)
{
int x = (intptr_t) str; // just to not use 0.
x ^= *str << 7;
for(int i = 0; i < len; i += 1)
x = (1000003UL * x) ^ *str++;
x ^= len;
if(x == -1)
x = -2;
return x;
}