Skip to content

Instantly share code, notes, and snippets.

@indatawetrust
Created August 24, 2016 20:45
Show Gist options
  • Save indatawetrust/45c72784bb2e0bb3c2771e3d818fb553 to your computer and use it in GitHub Desktop.
Save indatawetrust/45c72784bb2e0bb3c2771e3d818fb553 to your computer and use it in GitHub Desktop.
def random_string(length) do
:crypto.strong_rand_bytes(length) |> Base.url_encode64 |> binary_part(0, length)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment