Last active
December 10, 2015 20:38
-
-
Save jpountz/4489297 to your computer and use it in GitHub Desktop.
xxhash block hashing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| XXHashFactory factory = XXHashFactory.fastestInstance(); | |
| byte[] data = "12345345234572".getBytes("UTF-8"); | |
| XXHash32 hash32 = factory.hash32(); | |
| int seed = 0x9747b28c; // used to initialize the hash value, use whatever | |
| // value you want, but always the same | |
| int hash = hash32.hash(data, 0, data.length, seed); | |
| System.out.println("Block hash: " + hash); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment