StreamHash v0.1.1 StreamHash View Source

Stream into md5, ripemd160, sha, sha224, sha256, sha384, sha512 hash.

Link to this section Summary

Functions

Stream into hash

Link to this section Types

Link to this type hash_algorithms() View Source
hash_algorithms() ::
  :md5 | :ripemd160 | :sha | :sha224 | :sha256 | :sha384 | :sha512

Link to this section Functions

Stream into hash.

iex> :crypto.hash :sha256, "xyzxyz"
<<39, 48, 232, 165, 240, 181, 53, 170, 235, 10, 6, 92, 81, 0, 80, 44, 98, 156, 191, 32, 80, 240, 113, 154, 64, 73, 230, 192, 127, 22, 146, 205>>

iex> ["xyz"] |> Stream.cycle |> Stream.take(2) |> StreamHash.hash(:sha256) |> Enum.into("")
<<39, 48, 232, 165, 240, 181, 53, 170, 235, 10, 6, 92, 81, 0, 80, 44, 98, 156, 191, 32, 80, 240, 113, 154, 64, 73, 230, 192, 127, 22, 146, 205>>