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

Standardize random string generation on stdnse.generate_random_string

This commit is contained in:
dmiller
2015-02-25 05:06:08 +00:00
parent f6733b2d89
commit db717c7543
10 changed files with 15 additions and 119 deletions

View File

@@ -137,12 +137,7 @@ end
-- generate a random hex-string of length 'length'
--
local function generate_random(length)
local rnd = ""
for i=1, length do
rnd = rnd .. string.format("%.2X", math.random(255))
end
return rnd
return stdnse.generate_random_string(length * 2, '0123456789ABCDEF')
end