diff --git a/src/bits.erl b/src/bits.erl index 4988ab3..cb3b2a7 100644 --- a/src/bits.erl +++ b/src/bits.erl @@ -15,7 +15,7 @@ -module(bits). -export([reverse/1, duplicate/2, append/1, bitlist/1, bitstring/1, stringbits/1]). --compile(export_all). +% export_all removed to avoid warnings; module already exports explicit API. reverse(Bin) -> reverse(Bin, <<>>). diff --git a/src/qrcode_demo.erl b/src/qrcode_demo.erl index aa27174..5522629 100644 --- a/src/qrcode_demo.erl +++ b/src/qrcode_demo.erl @@ -41,7 +41,7 @@ -include("qrcode.hrl"). --compile(export_all). +% export_all removed to avoid warnings; demo module is not part of the public API. -define(TTY(Term), io:format(user, "[~p] ~p~n", [?MODULE, Term])). -define(PERIOD, 30). @@ -108,7 +108,7 @@ totp(Key, Period) -> %% RFC-4226 "HOTP: An HMAC-Based One-Time Password Algorithm" %% @ref hotp(Key, Count) when is_binary(Key), is_integer(Count) -> - HS = crypto:hmac(sha, Key, <>), + HS = crypto:mac(hmac, sha, Key, <>), <<_:19/binary, _:4, Offset:4>> = HS, <<_:Offset/binary, _:1, P:31, _/binary>> = HS, HOTP = integer_to_list(P rem 1000000),