1 | // from https://stackoverflow.com/questions/664014/what-integer-hash-function-are-good-that-accepts-an-integer-hash-key |
2 | // reversed by: unscrambleInt |
3 | static int scrambleInt(int x) { |
4 | x = ((x >>> 16) ^ x) * 0x45d9f3b; |
5 | x = ((x >>> 16) ^ x) * 0x45d9f3b; |
6 | x = (x >>> 16) ^ x; |
7 | ret x; |
8 | } |
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1034916 |
Snippet name: | scrambleInt - Thomas Müller's reversible int hash function |
Eternal ID of this version: | #1034916/1 |
Text MD5: | 25ed3fc9f387f1ad1ad333ab2236f2bd |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-03-15 13:24:03 |
Source code size: | 293 bytes / 8 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 118 / 132 |
Referenced in: | [show references] |