Skip to content

Instantly share code, notes, and snippets.

@lacrosse
Created April 8, 2016 05:17
Show Gist options
  • Save lacrosse/a259069cb4482ad0087c7a29059254d1 to your computer and use it in GitHub Desktop.
Save lacrosse/a259069cb4482ad0087c7a29059254d1 to your computer and use it in GitHub Desktop.
defmodule SecureRandom do
def hex(number \\ 16) do
:crypto.strong_rand_bytes(number)
|> Base.encode16(case: :lower)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment