-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[feat] - Add Generic Hasher Interface with Blake2b Implementation #3337
Conversation
May I suggest using blake2b? I've added it to this PR. It's a fast cryptographic hash function that is only ~4x slower than FNV when using the default 256 bit settings. |
Oh whoops, I might've forced pushed over your change 🤦 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall this lgtm; love the extensive testing and benchmarks! just had one question about thread safety.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an out of date comment and possibly useless MutexHasher
struct, but lgtm!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Should we have anything other than Blake2b for what we'll be using this for though?
I was thinking we'd use the SHA256 hasher for enterprise, but I supposed we could implement the interface outside of OSS. |
No, it's a different alg that we'd implement in enterprise. |
…ufflesecurity#3337) * Add hasher interface and fnv + sha256 implemenations * update * remove * fix test * update * remove * remove * fix spelling
Description:
This PR includes the following:
Hasher
interface to abstract hashing functionality.FNVHasher
using the FNV-64a algorithm.SHA256Hasher
using the SHA-256 algorithm.Bechmarks
Checklist:
make test-community
)?make lint
this requires golangci-lint)?