jlouis / enacl

Erlang bindings for NaCl / libsodium
MIT License
197 stars 59 forks source link

Typespec for `generichash` advertises `iodata`, but seemingly doesn't work #62

Open cognivore opened 2 years ago

cognivore commented 2 years ago

Steps to reproduce

  1. Use 1.2.1
iex(doma@redacted A> :enacl.generichash(32, ["hello", "world"], "")
** (ArgumentError) argument error
    (enacl 1.2.1) :enacl_nif.crypto_generichash(32, ["hello", "world"], "")
iex(doma@redacted B> :enacl.generichash(32, "helloworld", "")
<<60, 34, 131, 6, 85, 33, 119, 245, 163, 4, 203, 18, 165, 181, 230, 8, 151, 242,
  244, 134, 182, 70, 113, 175, 220, 207, 15, 141, 217, 65, 12, 189>>

Expected behaviour

Outputs A and B are the same.