Skip to content

Commit 86aada5

Browse files
authored
change: make random.bytes cryptographically strong by default.
1 parent 6f1bc21 commit 86aada5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/resty/random.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ int RAND_pseudo_bytes(unsigned char *buf, int num);
1919

2020

2121
function _M.bytes(len, strong)
22+
if strong == nil then
23+
strong = true
24+
end
2225
local buf = ffi_new("char[?]", len)
2326
if strong then
2427
if C.RAND_bytes(buf, len) == 0 then

0 commit comments

Comments
 (0)