scala-hashing
scala-hashing copied to clipboard
How do I actually get a 64 bit hash out of this?
This is giving me 19 bit hashes, not 64?
Can you provide an example? All the Hash64 methods return an 8 byte Long (64-bits).
trait Hash64 {
def hashByte(input: Byte, seed: Long): Long
def hashInt(input: Int, seed: Long): Long
def hashLong(input: Long, seed: Long): Long
def hashByteArray(input: Array[Byte], seed: Long): Long
def hashByteArray(input: Array[Byte], offset: Int, length: Int, seed: Long): Long
def hashByteBuffer(input: ByteBuffer, seed: Long): Long
def hashByteBuffer(input: ByteBuffer, offset: Int, length: Int, seed: Long): Long
}
Oh I'm an idiot - I see my problem. I also don't know where I got "19" from, that's not what I meant to type... my bad. Thank you for answering my stupid question.
Other hopefully non-stupid as hell question, do you know how difficult it would be to make a 128 bit implementation of this? I was looking through it trying to figure that out, but wanted to gauge the expert's opinion on the level of effort before I forked it and all that.