ExWeb3 / ex_keccak

Elixir library for computing Keccak SHA3-256 hashes using a NIF built tiny-keccak Rust crate.
Apache License 2.0
25 stars 20 forks source link

do not fail on invalid type #1

Closed ayrat555 closed 3 years ago

ayrat555 commented 3 years ago

Currently, ExKeccak.hash_256/1 raises an exception when invalid data is provided. This PR changes error handling logic. Now {:error, :invalid_type} will be returned if the provided data is not binary

ayrat555 commented 3 years ago

@tzumby thanks for the awesome library. Can you please take a look at this PR when you have time?

tzumby commented 3 years ago

Thanks @ayrat555, this is awesome! Approving it now but I'll cut a release tomorrow.