Merge pull request #2 from sparrell/erlang_server

Update deprecated crypto:rand_uniform
This commit is contained in:
Michael Stair
2018-03-03 15:08:17 -05:00
committed by GitHub
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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(),
+1 -1
View File
@@ -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.