Mercurial > prosody-hg
view util/hex.lua @ 6482:410067cdeb2f
net/server: If server.hook_signal exists, overwrite signal.signal; else make server.hook_signal == signal.signal
No longer server_event specific
server.hook_signal will always exist
| author | daurnimator <quae@daurnimator.com> |
|---|---|
| date | Tue, 21 Oct 2014 17:26:48 -0400 |
| parents | 3f4809d01783 |
| children | ec566d7cd518 |
line wrap: on
line source
local s_char = string.char; local function char_to_hex(c) return ("%02x"):format(c:byte()) end local function hex_to_char(h) return s_char(tonumber(h, 16)); end local function to(s) return s:gsub(".", char_to_hex); end local function from(s) return s:gsub("..", hex_to_char); end return { to = to, from = from }
