mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-01-22 23:08:50 +08:00
14 lines
249 B
Elixir
14 lines
249 B
Elixir
|
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
|