mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 06:40:48 +00:00
Cache the alpha charset for random_alpha to avoid regenerating it every time.
This commit is contained in:
parent
37384c2225
commit
c76424deb7
1 changed files with 2 additions and 1 deletions
|
|
@ -79,6 +79,7 @@ function charset(left_bound, right_bound, charset)
|
|||
end
|
||||
local charset = charset
|
||||
|
||||
local alpha_charset = charset('a', 'z')
|
||||
--- Generate a random alpha word
|
||||
--
|
||||
-- Convenience wrapper around <code>random_string</code> to generate a random
|
||||
|
|
@ -86,7 +87,7 @@ local charset = charset
|
|||
-- @param len The length of word to return
|
||||
-- @return A string of random characters between 'a' and 'z' inclusive.
|
||||
function random_alpha (len)
|
||||
return random_string(len, charset('a', 'z'))
|
||||
return random_string(len, alpha_charset)
|
||||
end
|
||||
|
||||
return _ENV
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue