mirror of
https://github.com/SerenityOS/serenity
synced 2024-11-05 17:46:52 +00:00
27f699ef0c
These types can be picked up by including <AK/Types.h>: * u8, u16, u32, u64 (unsigned) * i8, i16, i32, i64 (signed)
19 lines
357 B
C
19 lines
357 B
C
#pragma once
|
|
|
|
#include "Types.h"
|
|
|
|
inline unsigned int_hash(u32 key)
|
|
{
|
|
key += ~(key << 15);
|
|
key ^= (key >> 10);
|
|
key += (key << 3);
|
|
key ^= (key >> 6);
|
|
key += ~(key << 11);
|
|
key ^= (key >> 16);
|
|
return key;
|
|
}
|
|
|
|
inline unsigned pair_int_hash(u32 key1, u32 key2)
|
|
{
|
|
return int_hash((int_hash(key1) * 209) ^ (int_hash(key2 * 413)));
|
|
}
|