hexa_hash = crypto.blake2b(message)
hexa_hash = crypto.blake2b(message, key)
hexa_hash = crypto.blake2b(message, key, digestSize)
hexa_hash = crypto.blake2b(filename, key, digestSize, '-file')
| Parameter | Description |
|---|---|
| message | a uint8 vector (raw bytes) or a character vector (UTF-8 bytes): content to hash. |
| filename | a string: existing file whose raw bytes are hashed. |
| key | a uint8 vector (raw bytes) or a character vector (UTF-8 bytes) of at most 64 bytes, or [] for an unkeyed hash (default). |
| digestSize | an integer between 1 and 64: digest length in bytes (default: 64). |
| '-file' | first argument is a filename (always the last argument). |
| Parameter | Description |
|---|---|
| hexa_hash | a character vector: 2 * digestSize lowercase hexadecimal characters. |
crypto.blake2b computes a BLAKE2b digest (RFC 7693): a fast cryptographic hash with a configurable output size. With a key it acts as a message authentication code without the HMAC construction.
R = crypto.blake2b('abc')
R = crypto.blake2b('abc', [], 20)
R = crypto.blake2b('abc', 'my secret key', 32)
filename = [tempdir(), 'blake2b_example.txt'];
filewrite(filename, 'abc');
R = crypto.blake2b(filename, [], 64, '-file')
| Version | Description |
|---|---|
| 2.0.0 | initial version |