Fumofumotris/source/fumoengine/include/hash.c
Julia 1dcea1a2cf jjdjd
a
2024-04-30 16:41:31 -05:00

24 lines
369 B
C

#include <iso646.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "fumocommon.h"
typedef u32 hashtype;
hashtype Hash(void *item, size_t size)
{
u8 *data = (u8 *)item;
u32 h = 98317;
for (size_t i = 0; i < size; i++) {
h ^= data[i];
h *= 0x5bd1e995;
h ^= h >> 15;
}
return h;
}