Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
YWaller opened this issue Apr 13, 2021 · 2 comments
Open

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

YWaller opened this issue Apr 13, 2021 · 2 comments

Comments

@YWaller
Copy link

YWaller commented Apr 13, 2021

This is giving me 19 bit hashes, not 64?

@desmondyeung
Copy link
Owner

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
}

@YWaller
Copy link
Author

YWaller commented Apr 23, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants