-
Notifications
You must be signed in to change notification settings - Fork 476
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
Add blake3
and blake3_file
hash functions
#1860
Conversation
Love it, this is super cool. |
These functions provide a faster alternative to `sha256` and `sha256_file`. In particular, `blake3_file` uses memory map to avoid reading the entire file into memory, as well as parallelization to calculate the hash (this is consistent with the `b3sum` command line tool).
Awesome! I rebased so this should be all set for a look. |
Nice, LGTM! I used |
I also added |
Awesome, thanks! |
Blake3 is a hash algorithm that is pretty popular when working with larger files, and is also (in theory) closer to SHA-3 in security than SHA-2. I believe it is used by sccache and some other larger build systems.
This adds
blake3
andblake3_file
functions.blake3_file
is especially of note because it uses mmap and parallelization rather than reading the file into memory, so it should outperformsha256_file
quite a bit (this is the same function used by theb3sum
utility).I need to rebase since I did this a while ago, but I may as well get your thoughts here.