1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-30 11:29:01 +00:00

Replace msrpc.random_crap with stdnse.generate_random_string

This commit is contained in:
dmiller
2015-02-25 05:06:05 +00:00
parent 8f939279ca
commit f6733b2d89
3 changed files with 5 additions and 26 deletions

View File

@@ -5083,21 +5083,4 @@ function get_pad(data, align, pad_byte)
return string.rep(pad_byte, (align-#data%align)%align)
end
--####################################################################--
---Generates a random string of the requested length.
--@param length The length of the string to return.
--@param charset The set of letters to choose from. Default: ASCII letters and numbers
--@return The random string.
--####################################################################--
function random_crap(length, charset)
charset = charset or "0123456789abcdefghijklmnoprstuvzxwyABCDEFGHIJKLMNOPRSTUVZXWY"
local random_str = ""
for i = 1, length, 1 do
local random = math.random(#charset)
random_str = random_str .. string.sub(charset, random, random)
end
return random_str
end
return _ENV;