summaryrefslogtreecommitdiff
path: root/lib/chessh/utils.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chessh/utils.ex')
-rw-r--r--lib/chessh/utils.ex6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/chessh/utils.ex b/lib/chessh/utils.ex
index 20a8b96..1900793 100644
--- a/lib/chessh/utils.ex
+++ b/lib/chessh/utils.ex
@@ -1,4 +1,6 @@
defmodule Chessh.Utils do
+ require Logger
+
@ascii_chars Application.compile_env!(:chessh, :ascii_chars_json_file)
|> File.read!()
|> Jason.decode!()
@@ -35,4 +37,8 @@ defmodule Chessh.Utils do
calc = index + delta
if(calc < 0, do: length, else: 0) + rem(calc, length)
end
+
+ def random_token() do
+ :crypto.strong_rand_bytes(16) |> Base.encode16()
+ end
end