49
49
is_user_exists_in_other_modules/3,
52
plain_password_required/1
52
plain_password_required/1,
55
56
-export([auth_modules/1]).
322
%% @spec (IOList) -> non_negative_float()
323
%% @doc Calculate informational entropy.
325
case binary_to_list(iolist_to_binary(IOList)) of
330
fun(C, [Digit, Printable, LowLetter, HiLetter, Other]) ->
331
if C >= $a, C =< $z ->
332
[Digit, Printable, 26, HiLetter, Other];
334
[9, Printable, LowLetter, HiLetter, Other];
336
[Digit, Printable, LowLetter, 26, Other];
337
C >= 16#21, C =< 16#7e ->
338
[Digit, 33, LowLetter, HiLetter, Other];
340
[Digit, Printable, LowLetter, HiLetter, 128]
342
end, [0, 0, 0, 0, 0], S),
343
length(S) * math:log(lists:sum(Set))/math:log(2)
322
346
%%%----------------------------------------------------------------------
323
347
%%% Internal functions