diff options
author | Elizabeth (Lizzy) Hunt <elizabeth.hunt@simponic.xyz> | 2023-05-29 16:28:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-29 16:28:27 -0700 |
commit | eec32aa38a8762eccc8575a37a628bd5ae2cc1d0 (patch) | |
tree | 27f656780f5d25325c9ac0ec3db3557d774bf414 /lib/chessh/utils.ex | |
parent | 8a5a2f358cb1f63a255b2daf6908536583986448 (diff) | |
download | chessh-eec32aa38a8762eccc8575a37a628bd5ae2cc1d0.tar.gz chessh-eec32aa38a8762eccc8575a37a628bd5ae2cc1d0.zip |
Bots (#23)
* squash all the things for bots
* fix warnings
* change colors a bit and README updates
* fix frontend warnings
Diffstat (limited to 'lib/chessh/utils.ex')
-rw-r--r-- | lib/chessh/utils.ex | 6 |
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 |