exth_crypto v0.1.6 ExthCrypto.Hash
A variety of functions to handle one-way hashing functions as defined by Ethereum.
Link to this section Summary
Functions
Runs the specified hash type on the given data
Returns a list of supported hash algorithms
The KECCAK hasher, as defined by Ethereum
The SHA1 hasher
Link to this section Types
Link to this section Functions
Runs the specified hash type on the given data.
Examples
iex> ExthCrypto.Hash.hash("hello world", ExthCrypto.Hash.kec) |> ExthCrypto.Math.bin_to_hex
"47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad"
iex> ExthCrypto.Hash.hash("hello world", ExthCrypto.Hash.sha1) |> ExthCrypto.Math.bin_to_hex
"2aae6c35c94fcfb415dbe95f408b9ce91ee846ed"
Returns a list of supported hash algorithms.
The KECCAK hasher, as defined by Ethereum.
The SHA1 hasher.