diff options
author | Kim Alvefur <zash@zash.se> | 2022-02-15 13:03:02 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2022-02-15 13:03:02 +0100 |
commit | 57c35404ef932a33868a9abd5b5e4ebf9d2d5508 (patch) | |
tree | e3d483fafb0a127d10c3e8f9e8be83ef8a9d6dbd | |
parent | 26b898bc5222f1f42bfcc2658ccf76341e81da6e (diff) | |
download | prosody-57c35404ef932a33868a9abd5b5e4ebf9d2d5508.tar.gz prosody-57c35404ef932a33868a9abd5b5e4ebf9d2d5508.zip |
util.dns: Replace base16 implementation with util.hex
Less code!
-rw-r--r-- | util/dns.lua | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/util/dns.lua b/util/dns.lua index 81e20971..bad20463 100644 --- a/util/dns.lua +++ b/util/dns.lua @@ -9,7 +9,6 @@ local table = table; local t_concat = table.concat; local t_insert = table.insert; local s_byte = string.byte; -local s_char = string.char; local s_format = string.format; local s_gsub = string.gsub; local s_sub = string.sub; @@ -23,15 +22,7 @@ if have_net and not net_util.ntop then -- Added in Prosody 0.11 have_net = false; end -local chartohex = {}; - -for c = 0, 255 do - chartohex[s_char(c)] = s_format("%02X", c); -end - -local function tohex(s) - return (s_gsub(s, ".", chartohex)); -end +local tohex = require "util.hex".to; -- Simplified versions of Waqas DNS parsers -- Only the per RR parsers are needed and only feed a single RR |