function string2hex(str)
assert(str,"String2hex got null argument")
local h,s = string.gsub(str, "(.)", function(c) return string.format("%02X", string.byte(c)) end)
return h
end
The size of input strings can be from 1kb to 1Mb.
How would you optimize it ?
thanks for any suggestion,
valerio