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

Concurrency Issue #6

Closed
kpowers122 opened this issue May 11, 2019 · 1 comment · Fixed by #7

Comments

@kpowers122
Copy link

@kpowers122 kpowers122 commented May 11, 2019

Really appreciate this library, we use it a lot.

Just wanted to make others aware if you use the examples in highly concurrent code, you will want to create your own unique instance of the hashers rather than the constants in the library as you will get inconsistent results:

Instead of this:
h := jump.HashString("127.0.0.1", 8, jump.CRC64)

You would do this:
h := jump.HashString("127.0.0.1", 8, crc64.New(crc64.MakeTable(crc64.ECMA)))

Just sharing for others.

@lithammer

This comment has been minimized.

Copy link
Owner

@lithammer lithammer commented May 13, 2019

Hmm, good find. I suspect it's because the hasher is reset at the start of HashString, hmm 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.