Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/mongo.erl
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,10 @@ auth (Username, Password) ->
catch error:{bad_command, _} -> false end.

-spec pw_key (nonce(), username(), password()) -> bson:utf8().
pw_key (Nonce, Username, Password) -> bson:utf8 (binary_to_hexstr (crypto:md5 ([Nonce, Username, pw_hash (Username, Password)]))).
pw_key (Nonce, Username, Password) -> bson:utf8 (binary_to_hexstr (erlang:md5 ([Nonce, Username, pw_hash (Username, Password)]))).

-spec pw_hash (username(), password()) -> bson:utf8().
pw_hash (Username, Password) -> bson:utf8 (binary_to_hexstr (crypto:md5 ([Username, <<":mongo:">>, Password]))).
pw_hash (Username, Password) -> bson:utf8 (binary_to_hexstr (erlang:md5 ([Username, <<":mongo:">>, Password]))).

-spec binary_to_hexstr (binary()) -> string().
binary_to_hexstr (Bin) ->
Expand Down