Skip to content

Commit

Permalink
Update deprecated crypto:rand_uniform
Browse files Browse the repository at this point in the history
plus fix missing newline
  • Loading branch information
sparrell committed Mar 3, 2018
1 parent 5c5911e commit 3c94f92
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion erlang/src/fwknop.erl
Expand Up @@ -73,7 +73,7 @@ strip_base64( Bin ) ->
list_to_binary( reverse( dropwhile( F, reverse( binary_to_list( Bin ) ) ) ) ).

random_digits( N ) ->
list_to_binary( [ nth( crypto:rand_uniform( 1, 10 ), "0123456789" ) || _ <- seq( 1, N ) ] ).
list_to_binary( [ nth( rand:uniform( 10 ), "0123456789" ) || _ <- seq( 1, N ) ] ).

timestamp() ->
{ A, B, _ } = os:timestamp(),
Expand Down
2 changes: 1 addition & 1 deletion erlang/src/server.erl
Expand Up @@ -36,7 +36,7 @@ accept(Socket, { Key, Hmac } = Creds) ->
{ok, Ciphertext} = verify( Bin, Hmac ),
{ok, Plaintext} = decrypt( Ciphertext, Key ),
{ok, Message} = decode( Plaintext ),
error_logger:info_msg( "Got message: ~p", [ Message ] ),
error_logger:info_msg( "Got message: ~p~n", [ Message ] ),

accept( Socket, Creds )
end.
Expand Down

0 comments on commit 3c94f92

Please sign in to comment.