Skip to content

Instantly share code, notes, and snippets.

@krisives
Created June 28, 2015 00:54
Show Gist options
  • Save krisives/723aaaade96f0e89bf82 to your computer and use it in GitHub Desktop.
Save krisives/723aaaade96f0e89bf82 to your computer and use it in GitHub Desktop.
uint32_t hash = key ^ 4228504496;
uint32_t a = key ^ 2744700229;
uint32_t b = key ^ 314303103;
uint32_t c = key ^ 474819853;
c += (b + 314303103) + (key << ((key & 0x3) * 8));
b += (hash + c) + 314303103;
hash += (a + 2744700229) + 314303103;
b ^= (b ^ hash) ^ key;
b ^= (c ^ 474819853) ^ (key >> ((hash & 0x3) * 8));
b += (c ^ 314303103) + key;
hash += (a + 2744700229) + 314303103;
hash += (c + 474819853) + key;
c += (hash ^ 4228504496) + 314303103;
a += (c + 2744700229) + 314303103;
a ^= (hash + c) + (key >> ((hash & 0x3) * 8));
c += (c + b) + 314303103;
hash += (b ^ 314303103) + key;
a += (a ^ b) + key;
a += (c + b) + key;
b += (hash ^ a) + 314303103;
hash += (c + b) + 314303103;
c ^= (hash ^ 4228504496) ^ 474819853;
a ^= (b + 2744700229) + (key >> ((hash & 0x3) * 8));
c += (a ^ 474819853) + key;
a ^= (c + hash) + (key >> ((hash & 0x3) * 8));
c += (a ^ 474819853) + key;
hash += (hash + b) + 314303103;
hash ^= (a ^ c) ^ key;
return (hash ^ a ^ b ^ c);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment