Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BLAKE3 is a performant and versatile hash function. It's the successor to the well-studied BLAKE2 family of hashes. I'd like to use for some projects, and I think could make a nice addition to the standard library.
If there is interest, here is a PR which adds it to std/hash via the official Rust implementation. (Per #658 it looks like we wouldn't want to also include a TypeScript implementation.)
I'm not sure if this is redundant with the ongoing work on WebCrypto. However, the WebCrypto specification seems to only include SHA-1 and SHA-2-family digests, so perhaps this implementation would still be useful until/unless a
"blake3"
option is added to that specification.Adds support for the BLAKE3 hash function to std/hash.
This uses the official blake3 Rust crate, via the hash/_wasm/wasm.js bundle.
No TypeScript implementation is included.
This includes only the primary BLAKE3 function with its default 256-bit output length.
This does NOT expose its secondary modes or support for variable-length output.
Test cases were generated using the official b3sum CLI.
For example, for testSetBase64.blake3.millionAs: