Comparison

mod_http_upload/mod_http_upload.lua @ 2647:d8487d5bd4fb

mod_http_upload: Fix to call random bytes function instead of the module
author Kim Alvefur <zash@zash.se>
date Sun, 26 Mar 2017 21:09:02 +0200
parent 2646:45ef16ebe565
child 2648:4c92e2e897c8
comparison
equal deleted inserted replaced
2646:45ef16ebe565 2647:d8487d5bd4fb
20 local uuid = require"util.uuid".generate; 20 local uuid = require"util.uuid".generate;
21 if have_random then 21 if have_random then
22 local b64 = require "util.encodings".base64; 22 local b64 = require "util.encodings".base64;
23 local b64url = { ['+'] = '-', ['/'] = '_', ['='] = '' }; 23 local b64url = { ['+'] = '-', ['/'] = '_', ['='] = '' };
24 function uuid() 24 function uuid()
25 return (b64(random(8)):gsub("[+/=]", b64url)); 25 return (b64(random.bytes(8)):gsub("[+/=]", b64url));
26 end 26 end
27 end 27 end
28 28
29 local function join_path(...) -- COMPAT util.path was added in 0.10 29 local function join_path(...) -- COMPAT util.path was added in 0.10
30 return table.concat({ ... }, package.config:sub(1,1)); 30 return table.concat({ ... }, package.config:sub(1,1));