StreamHash v0.3.1 StreamHash View Source
Stream into SHA1, SHA2, SHA3, BLAKE2, RIPEMD-160 hash. (Hash algorithms which Erlang is supporting.)
Link to this section Summary
Functions
Stream into hash.
Link to this section Types
Link to this type
hash_algorithms()
View Sourcehash_algorithms() :: :blake2b | :blake2s | :ripemd160 | :sha | :sha224 | :sha256 | :sha384 | :sha3_224 | :sha3_256 | :sha3_384 | :sha3_512 | :sha512
Link to this section Functions
Link to this function
hash(enum, algorithm)
View Sourcehash(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.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>>