1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-25 07:39:02 +00:00

o Enhanced the tohex() function in the NSE stdnse library to support strings

and added options to control the formatting. [Sven]
This commit is contained in:
sven
2008-10-03 19:55:58 +00:00
parent 7f9bac76b2
commit 565a5ee3ed
3 changed files with 46 additions and 9 deletions

View File

@@ -1910,12 +1910,17 @@ if(s) code_to_be_done_on_match end
</listitem>
</varlistentry>
<varlistentry>
<term><option>string = stdnse.tohex(n)</option>
<term><option>string = stdnse.tohex(s, options)</option>
</term>
<listitem>
<para>
Converts the given number, <literal>n</literal>, to a string
in a hexadecimal number format (e.g. 10 becomes "a").
Converts the given number or string, <literal>s</literal>, to a
string in a hexadecimal number format (e.g. 10 becomes "a").
<literal>options</literal> is a table containing parameters to
control the formatting. You may specify <literal>options.separator</literal>
which will be used as separator for groups of consecutive bytes.
With <literal>options.group</literal> you can control the group
length to be used with <literal>options.separator</literal>.
</para>
</listitem>
</varlistentry>