aboutsummaryrefslogtreecommitdiffstats
path: root/util/hex.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2015-09-02 18:55:35 +0100
committerMatthew Wild <mwild1@gmail.com>2015-09-02 18:55:35 +0100
commitee2c04d00330a6ac76b6360d2d06b02bcc001546 (patch)
tree75ae2e07fd0ffea8a7063e9fbc3e5dbd0108d619 /util/hex.lua
parent0944fb2e1b3c6b10fef40e93e0ba0ae72795acac (diff)
parent63f8291d160b050741e804e5a58e392381555e14 (diff)
downloadprosody-ee2c04d00330a6ac76b6360d2d06b02bcc001546.tar.gz
prosody-ee2c04d00330a6ac76b6360d2d06b02bcc001546.zip
Merge 0.10->trunk
Diffstat (limited to 'util/hex.lua')
-rw-r--r--util/hex.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/hex.lua b/util/hex.lua
index e41f4863..4cc28d33 100644
--- a/util/hex.lua
+++ b/util/hex.lua
@@ -1,6 +1,7 @@
local s_char = string.char;
local s_format = string.format;
local s_gsub = string.gsub;
+local s_lower = string.lower;
local char_to_hex = {};
local hex_to_char = {};
@@ -19,7 +20,7 @@ local function to(s)
end
local function from(s)
- return (s_gsub(s, "..", hex_to_char));
+ return (s_gsub(s_lower(s), "%X*(%x%x)%X*", hex_to_char));
end
return { to = to, from = from }