lua-resty-string
lua-resty-string copied to clipboard
是否能支持hex2byte
在lua-resty-string中已经实现to_hex,不知能否加一个from_hex,更加高效实现hex到byte的转换? 谢谢 我现在使用gsub的方式:
function from_hex(s)
return (s:gsub('..', function(cc)
return string.char(tonumber(cc, 16))
end))
end
最近看到了ndk.set_var.DIRECTIVE中有两个set_encode_hex 和 set_decode_hex,是不是因为这个,而没有在string库增加?