Packages

BLAKE3 bindings for gleam targeting both erlang and javascript.

Current section

Files

Jump to
gblake3 src gblake3_ffi.ex
Raw

src/gblake3_ffi.ex

defmodule Gblake3 do
@moduledoc """
B3 wrapper for Gblake3
"""
@doc """
Wrapper for the B3.hash method with the keyword :length specified.
Length is the number of bytes to output
"""
@spec hash_len(binary(), integer()) :: binary()
def hash_len(message, length) do
B3.hash(message, length: length)
end
@doc """
Wrapper for the B3.derive_key method with the keyword :length specified.
Length is the number of bytes to output
"""
@spec derive_key_len(binary(), binary(), integer()) :: binary()
def derive_key_len(key_material, context, length) do
B3.derive_key(key_material, context, length: length)
end
end