Update emqttd_auth_mod.erl

This commit is contained in:
huangpengju 2017-03-09 09:29:31 +08:00 committed by GitHub
parent 78b0f66910
commit b5ff80499a
1 changed files with 1 additions and 2 deletions

View File

@ -62,8 +62,7 @@ passwd_hash(sha256, Password) ->
hexstring(crypto:hash(sha256, Password));
passwd_hash(pbkdf2,{Salt,Password,Macfun,Iterations,Dklen}) ->
{ok,Hexstring} = pbkdf2:pbkdf2(Macfun, Password, Salt, Iterations, Dklen),
hexstring(Hexstring).
pbkdf2:to_hex(Hexstring).
hexstring(<<X:128/big-unsigned-integer>>) ->
iolist_to_binary(io_lib:format("~32.16.0b", [X]));