Fix passwd_hash return type error
This commit is contained in:
parent
989d2fd9e7
commit
5d30ceccd1
|
@ -63,12 +63,12 @@ passwd_hash(sha256, Password) ->
|
|||
passwd_hash(pbkdf2, {Salt, Password, Macfun, Iterations, Dklen}) ->
|
||||
case pbkdf2:pbkdf2(Macfun, Password, Salt, Iterations, Dklen) of
|
||||
{ok, Hexstring} -> pbkdf2:to_hex(Hexstring);
|
||||
{error, Error} -> lager:error("PasswdHash with pbkdf2 error:~p", [Error]), error
|
||||
{error, Error} -> lager:error("PasswdHash with pbkdf2 error:~p", [Error]), <<>>
|
||||
end;
|
||||
passwd_hash(bcrypt, {Salt, Password}) ->
|
||||
case bcrypt:hashpw(Password, Salt) of
|
||||
{ok, HashPassword} -> list_to_binary(HashPassword);
|
||||
{error, Error}-> lager:error("PasswdHash with bcrypt error:~p", [Error]), error
|
||||
{error, Error}-> lager:error("PasswdHash with bcrypt error:~p", [Error]), <<>>
|
||||
end.
|
||||
|
||||
hexstring(<<X:128/big-unsigned-integer>>) ->
|
||||
|
|
Loading…
Reference in New Issue