summaryrefslogtreecommitdiff
path: root/src/mod_admin_extra.erl
diff options
context:
space:
mode:
authorPeter Lemenkov <lemenkov@gmail.com>2017-02-13 18:35:57 +0300
committerPeter Lemenkov <lemenkov@gmail.com>2017-02-13 18:42:50 +0300
commite7733ce7d97376bf41d0c683ce3888838a7ea985 (patch)
treeb5151424a014b0697a0f7663d54fc22e588faf09 /src/mod_admin_extra.erl
parentCheck result of gen_mod:start/2 callback (#1534) (diff)
Use crypto:hash/2 function
Use crypto:hash/2 function instead of ones from p1_sha. This function exists since commit erlang/otp@208f9ad3828313f6c659a501d53f5534ec1bdf2e and also implemented as NIF, so I believe it's safe to use it. Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
Diffstat (limited to 'src/mod_admin_extra.erl')
-rw-r--r--src/mod_admin_extra.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mod_admin_extra.erl b/src/mod_admin_extra.erl
index 472e9fbe..9139f1e4 100644
--- a/src/mod_admin_extra.erl
+++ b/src/mod_admin_extra.erl
@@ -734,7 +734,7 @@ get_md5(AccountPass) ->
|| X <- binary_to_list(erlang:md5(AccountPass))]).
get_sha(AccountPass) ->
iolist_to_binary([io_lib:format("~2.16.0B", [X])
- || X <- binary_to_list(p1_sha:sha1(AccountPass))]).
+ || X <- binary_to_list(crypto:hash(sha, AccountPass))]).
num_active_users(Host, Days) ->
DB_Type = gen_mod:db_type(Host, mod_last),