Last active
July 11, 2018 15:43
-
-
Save JuneKelly/1690f3fe85a7894b769f4ced94d7f135 to your computer and use it in GitHub Desktop.
Youtube IDs in Elixir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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