Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local charset = {}
- -- qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890
- for i = 48, 57 do table.insert(charset, string.char(i)) end
- for i = 65, 90 do table.insert(charset, string.char(i)) end
- for i = 97, 122 do table.insert(charset, string.char(i)) end
- function string.random(length)
- math.randomseed(os.time())
- if length > 0 then
- return string.random(length - 1) .. charset[math.random(1, #charset)]
- else
- return ""
- end
- end
Add Comment
Please, Sign In to add comment