scala-hashing icon indicating copy to clipboard operation
scala-hashing copied to clipboard

How do I actually get a 64 bit hash out of this?

Open YWaller opened this issue 3 years ago • 2 comments

This is giving me 19 bit hashes, not 64?

YWaller avatar Apr 13 '21 20:04 YWaller

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
}

desmondyeung avatar Apr 22 '21 16:04 desmondyeung

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.

YWaller avatar Apr 23 '21 04:04 YWaller