StreamHash v0.1.0 StreamHash View Source
Stream into md4, 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 :: :md4 | :md5 | :ripemd160 | :sha | :sha224 | :sha256 | :sha384 | :sha512
Link to this section Functions
Link to this function
hash(enum, algorithm)
View Source
hash(Enumerable.t, hash_algorithms) :: Enumerable.t
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.to_list
[<<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>>]