riverrun / comeonin

Password hashing specification for the Elixir programming language

Home Page:https://hex.pm/packages/comeonin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

** (UndefinedFunctionError) function Bcrypt.Base.gensalt_nif/3

blackode opened this issue · comments

I am using Elixir V 1.5.1

comeonin, "~> 4.0 "
bcrypt_elixir, "~>1.0"
iex(2)> Comeonin.Bcrypt.hashpwsalt("mysecretpass")
[warn] The on_load function for module Elixir.Bcrypt.Base returned {:error,
 {:bad_lib,
  'NIF \'Elixir.Bcrypt.Base\':hash_nif/2 requires a runtime with dirty scheduler support.'}}

** (UndefinedFunctionError) function Bcrypt.Base.gensalt_nif/3 is undefined (module Bcrypt.Base is not available)
    (bcrypt_elixir) Bcrypt.Base.gensalt_nif([75, 149, 80, 213, 166, 174, 2, 77, 251, 164, 174, 209, 246, 97, 80, 189], 12, 98)
    (bcrypt_elixir) lib/bcrypt.ex:45: Bcrypt.gen_salt/2
    (bcrypt_elixir) lib/bcrypt.ex:78: Bcrypt.hash_pwd_salt/2
iex(2)> 

For bcrypt_elixir version 1.0, you need to be using Erlang 20.

Downgrade to bcrypt_elixir version 0.12, and there should be no problem.

Let me know if that works.

@riverrun Thanks for quick response. I am out now. I will let you know after either downgrading bcrypt_elixir or upgrading the erlang and testing.

@riverrun Glad it worked when I upgraded to erlang 20.0 Thanks 💐

According to @riverrun explained about the issue following his hints I Upgrading to erlang 20.0 It is working as expected now. Thanks to @riverrun for quick response.

Glad to hear you got it working. I'm just working on improving the error message now.

@riverrun error message with clear information what causing the error would be nice.... Glad to hear that you are working on that...