Skip to content

Instantly share code, notes, and snippets.

@JuneKelly
Last active July 11, 2018 15:43
Show Gist options
  • Save JuneKelly/1690f3fe85a7894b769f4ced94d7f135 to your computer and use it in GitHub Desktop.
Save JuneKelly/1690f3fe85a7894b769f4ced94d7f135 to your computer and use it in GitHub Desktop.
Youtube IDs in Elixir
def make_youtube_id() do
:crypto.strong_rand_bytes(8)
|> Base.url_encode64(padding: false)
end
# Produces 11-character strings like "NxdgQMuCZ5Q"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment