Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

是否能支持hex2byte #57

Open
zhengmz opened this issue May 8, 2018 · 1 comment
Open

是否能支持hex2byte #57

zhengmz opened this issue May 8, 2018 · 1 comment

Comments

@zhengmz
Copy link

zhengmz commented May 8, 2018

在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
@zhengmz
Copy link
Author

zhengmz commented May 9, 2018

最近看到了ndk.set_var.DIRECTIVE中有两个set_encode_hex 和 set_decode_hex,是不是因为这个,而没有在string库增加?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant