diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/dns.lua | 2 | ||||
-rw-r--r-- | util/hex.lua | 6 | ||||
-rw-r--r-- | util/ip.lua | 2 | ||||
-rw-r--r-- | util/uuid.lua | 2 |
4 files changed, 8 insertions, 4 deletions
diff --git a/util/dns.lua b/util/dns.lua index 9d80d1ec..3b58e03e 100644 --- a/util/dns.lua +++ b/util/dns.lua @@ -13,7 +13,7 @@ local s_format = string.format; local s_sub = string.sub; local iana_data = require "util.dnsregistry"; -local tohex = require "util.hex".to; +local tohex = require "util.hex".encode; local inet_ntop = require "util.net".ntop; -- Simplified versions of Waqas DNS parsers diff --git a/util/hex.lua b/util/hex.lua index 4cc28d33..6202620f 100644 --- a/util/hex.lua +++ b/util/hex.lua @@ -23,4 +23,8 @@ local function from(s) return (s_gsub(s_lower(s), "%X*(%x%x)%X*", hex_to_char)); end -return { to = to, from = from } +return { + encode = to, decode = from; + -- COMPAT w/pre-0.12: + to = to, from = from; +}; diff --git a/util/ip.lua b/util/ip.lua index 20b92466..4b450934 100644 --- a/util/ip.lua +++ b/util/ip.lua @@ -67,7 +67,7 @@ function ip_methods:normal() end function ip_methods.bits(ip) - return hex.to(ip.packed):upper():gsub(".", hex2bits); + return hex.encode(ip.packed):upper():gsub(".", hex2bits); end function ip_methods.bits_full(ip) diff --git a/util/uuid.lua b/util/uuid.lua index f4fd21f6..54ea99b4 100644 --- a/util/uuid.lua +++ b/util/uuid.lua @@ -8,7 +8,7 @@ local random = require "util.random"; local random_bytes = random.bytes; -local hex = require "util.hex".to; +local hex = require "util.hex".encode; local m_ceil = math.ceil; local function get_nibbles(n) |