exth_crypto v0.1.6 ExthCrypto.Hash.SHA
Helper functions for running Secure Hash Algorithm (SHA).
Link to this section Summary
Functions
Computes the SHA-1 of a given input
Computes the SHA-2 of a given input outputting 256 bits
Computes the SHA-2 of a given input outputting 384 bits
Computes the SHA-2 of a given input outputting 512 bits
Link to this section Functions
Computes the SHA-1 of a given input.
Examples
iex> ExthCrypto.Hash.SHA.sha1("The quick brown fox jumps over the lazy dog") |> ExthCrypto.Math.bin_to_hex
"2fd4e1c67a2d28fced849ee1bb76e7391b93eb12"
iex> ExthCrypto.Hash.SHA.sha1("") |> ExthCrypto.Math.bin_to_hex
"da39a3ee5e6b4b0d3255bfef95601890afd80709"
Computes the SHA-2 of a given input outputting 256 bits.
Examples
iex> ExthCrypto.Hash.SHA.sha256("") |> ExthCrypto.Math.bin_to_hex
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
Computes the SHA-2 of a given input outputting 384 bits.
Examples
iex> ExthCrypto.Hash.SHA.sha384("") |> ExthCrypto.Math.bin_to_hex
"38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b"