material/program/c_cpp/libs/string_hash.c
rangersly b462e74945 MERGE: fix
ADD:
        ./program/c_cpp/coding-style.md
        ./linux/command -> timeshift
    FIX:
        ./linux/arch/auto.sh
        ./linux/config/.bashrc
2025-05-31 09:16:27 +08:00

11 lines
241 B
C

// 非加密型hash,速度极快,支持种子
uint32_t murmur3_32(const char *key, size_t len, uint32_t seed) {
for(uint32_t i=0; i<len; i++)
{
seed ^= (const uint8_t)key[i];
seed *= 0x5bd1e995;
seed ^= seed>> 15;
}
return seed;
}