View Source Blake3 (blake3 v1.0.2)

Blake3 provides bindings to the rust implementaion of the BLAKE3 hashing algorithm. See the README for installation and usage examples

Link to this section Summary

Functions

same as derive_key/2 but uses an empty string for context

returns a 32 byte key for use for hash_keyed or new_keyed from the given context and key. for more information: crate

returns the binary of the current hash state for a given hasher

computes a message digest for the given data

computes a message digest for the given data and key. The key must be 32 bytes. if you need to use a key of a diffrent size you can use derive_key to get a key of a proper size.

returns a new reference for a Blake3 hasher to be used for streaming calls with update/2

returns a new reference for a Blake3 hasher using the passed key to be used for streaming calls with update/2

reset a hasher to the default stat like when calling Blake3.new

updates the hasher with the given data to be hashed the the refernce can be continouly passed to update/2 or when finished to finalize/1

updates state with the potential to multithreading. The rayon feature needs to be enabled and the input need to be large enough. for more information see: documentation

Link to this section Types

@type hasher() :: reference()

Link to this section Functions

@spec derive_key(key :: binary()) :: binary()
@spec derive_key(state :: hasher()) :: hasher()

same as derive_key/2 but uses an empty string for context

Link to this function

derive_key(context, key)

View Source
@spec derive_key(context :: binary(), key :: binary()) :: binary()

returns a 32 byte key for use for hash_keyed or new_keyed from the given context and key. for more information: crate

@spec finalize(state :: hasher()) :: binary()

returns the binary of the current hash state for a given hasher

@spec hash(data :: binary()) :: binary()

computes a message digest for the given data

@spec keyed_hash(key :: binary(), data :: binary()) :: binary() | {:error, String.t()}

computes a message digest for the given data and key. The key must be 32 bytes. if you need to use a key of a diffrent size you can use derive_key to get a key of a proper size.

@spec new() :: hasher()

returns a new reference for a Blake3 hasher to be used for streaming calls with update/2

@spec new_keyed(key :: binary()) :: hasher() | {:error, String.t()}

returns a new reference for a Blake3 hasher using the passed key to be used for streaming calls with update/2

reset a hasher to the default stat like when calling Blake3.new

@spec update(state :: hasher(), data :: binary()) :: hasher()

updates the hasher with the given data to be hashed the the refernce can be continouly passed to update/2 or when finished to finalize/1

Link to this function

update_rayon(state, data)

View Source
@spec update_rayon(state :: hasher(), data :: binary()) :: hasher()

updates state with the potential to multithreading. The rayon feature needs to be enabled and the input need to be large enough. for more information see: documentation