From eec32aa38a8762eccc8575a37a628bd5ae2cc1d0 Mon Sep 17 00:00:00 2001 From: "Elizabeth (Lizzy) Hunt" Date: Mon, 29 May 2023 16:28:27 -0700 Subject: Bots (#23) * squash all the things for bots * fix warnings * change colors a bit and README updates * fix frontend warnings --- lib/chessh/utils.ex | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/chessh/utils.ex') 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 -- cgit v1.2.3-70-g09d2