Skip to content

Instantly share code, notes, and snippets.

@nefftd
Created February 5, 2015 23:32
Show Gist options
  • Save nefftd/9ef1781f647e3efa970e to your computer and use it in GitHub Desktop.
Save nefftd/9ef1781f647e3efa970e to your computer and use it in GitHub Desktop.
local ASCII_PRINTABLE = {33,126}
local function genpass(len)
local amin,amax = (table.unpack or unpack)(ASCII_PRINTABLE)
local pass = {}
for i = 1,len do
pass[i] = math.random(amin,amax)
end
return string.char((table.unpack or unpack)(pass))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment