diff options
author | Steven Barth <steven@midlink.org> | 2008-06-25 16:38:48 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-06-25 16:38:48 +0000 |
commit | 7a4aa85dd64f72b9edcbf9310d0d95e59960d84e (patch) | |
tree | a1f18b6294c6423ed16d15eb76212030f7f068f6 /libs/core | |
parent | b85d292bcd13f7527d6a2c1d204ebf78bc417e06 (diff) |
* libs/httpd: Introduced keep-alive and pipelining support
Diffstat (limited to 'libs/core')
-rw-r--r-- | libs/core/luasrc/sys.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libs/core/luasrc/sys.lua b/libs/core/luasrc/sys.lua index 17caa7824..54c4e0613 100644 --- a/libs/core/luasrc/sys.lua +++ b/libs/core/luasrc/sys.lua @@ -134,6 +134,23 @@ function syslog() end +-- Generates a random key of length BYTES +function uniqueid(bytes) + local fp = io.open("/dev/urandom") + local chunk = { fp:read(bytes):byte(1, bytes) } + fp:close() + + local hex = "" + + local pattern = "%02X" + for i, byte in ipairs(chunk) do + hex = hex .. pattern:format(byte) + end + + return hex +end + + group = {} group.getgroup = posix.getgroup |