livebook/lib/live_book/utils.ex

14 lines
249 B
Elixir
Raw Normal View History

defmodule LiveBook.Utils do
@moduledoc false
@type id :: binary()
@doc """
Generates a random binary id.
"""
@spec random_id() :: binary()
def random_id() do
:crypto.strong_rand_bytes(20) |> Base.encode32(case: :lower)
end
end