Skip to content

Instantly share code, notes, and snippets.

@EnigmaCurry
Last active August 29, 2015 13:57
Show Gist options
  • Save EnigmaCurry/9401469 to your computer and use it in GitHub Desktop.
Save EnigmaCurry/9401469 to your computer and use it in GitHub Desktop.
Example of murmur3 hashing in Jython
from org.apache.cassandra.dht import Murmur3Partitioner
from org.apache.cassandra.utils import ByteBufferUtil
from java.lang import Integer
p = Murmur3Partitioner()
int_token = p.getToken(ByteBufferUtil.bytes(Integer(10)))
string_token = p.getToken(ByteBufferUtil.bytes("asdf"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment