Import std.crypto.blake3
std.crypto.blake3
Blake3, over BLAKE3's C code: a fast cryptographic hash of any length, 32 bytes unless asked for more or fewer, which can be keyed, as a MAC, or derive a key for a context, as a KDF.
std/crypto/blake3.fb
Types
Blake3
class
Public Class Blake3 Implements Hasher
BLAKE3's hash of what's added in turn, of any length, for checksums, keys, and anything else a fast cryptographic hash fits.
-
A plain hash.
-
A hasher whose hash is a MAC with
key, 32 bytes. Panics unlesskeyis 32 bytes. -
A hasher whose hash is a key for
context, from the material added:context, fixed in the program, says what the key is for, like "game 2026-10-23 save file encryption", so keys for different uses differ. -
data's hash,lengthbytes long. Panics whenlengthis negative. -
The hash of
text's UTF-8 bytes,lengthbytes long. Panics whenlengthis negative. -
@PanicsAtCaller Public Static Method KeyedHash(key: UInt8[], data: UInt8[], length: Int = 32): UInt8[]static method #data's MAC withkey, 32 bytes. Panics unlesskeyis 32 bytes, or whenlengthis negative. -
@PanicsAtCaller Public Static Method DeriveKey(context: String, material: UInt8[], length: Int = 32): UInt8[]static method #A key for
contextfrommaterial. Panics whenlengthis negative. -
Adds
datato what it hashes. -
Adds
text's UTF-8 bytes to what it hashes. -
The 32-byte hash of what was added, after which the hasher starts again, empty.
-
The same,
lengthbytes long, the first 32 of which are the 32-byte hash. Panics whenlengthis negative.
Report an issue with this page or with FutureBlitz on GitHub.