shortnr/lib/url/util.ex
mitchell 1502d10cdc Add HTTP wrap func and Text Encodable:
- Refactor HTTP send func
- Impl. Text Encodable for URL
- Error when url is not found
2020-01-01 18:11:38 -05:00

13 lines
321 B
Elixir

defmodule Shortnr.URL.Util do
@moduledoc """
URL module utility functions.
"""
@id_chars String.codepoints("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXWYZ0123456789")
@spec generate_id() :: String.t()
def generate_id do
for _ <- 0..7,
into: "",
do: Enum.random(@id_chars)
end
end