exth_crypto v0.1.6 ExthCrypto.Hash.Fake

Simple fake hash that basically just returns its own input.

Gasp, that’s reversable!

Link to this section Summary

Functions

Finalizes a given Fake mac stream to produce the current hash

Initializes a new Fake mac stream

Updates a given Fake mac stream, which is, do nothing

Link to this section Types

Link to this type fake_mac()
fake_mac() :: {:fake_mac, binary()}

Link to this section Functions

Link to this function final_mac(arg)
final_mac(fake_mac()) :: binary()

Finalizes a given Fake mac stream to produce the current hash.

Examples

iex> ExthCrypto.Hash.Fake.init_mac("abc")
...> |> ExthCrypto.Hash.Fake.update_mac("def")
...> |> ExthCrypto.Hash.Fake.final_mac()
"abc"
Link to this function init_mac(initial)
init_mac(binary()) :: fake_mac()

Initializes a new Fake mac stream.

Examples

iex> fake_mac = ExthCrypto.Hash.Fake.init_mac("abc")
iex> is_nil(fake_mac)
false
Link to this function update_mac(arg, data)
update_mac(fake_mac(), binary()) :: fake_mac()

Updates a given Fake mac stream, which is, do nothing.

Examples

iex> fake_mac = ExthCrypto.Hash.Fake.init_mac("init")
...> |> ExthCrypto.Hash.Fake.update_mac("data")
iex> is_nil(fake_mac)
false