Skip to content

Commit

Permalink
set uuid rng function
Browse files Browse the repository at this point in the history
  • Loading branch information
chbruyand committed Nov 25, 2024
1 parent e745a5f commit fe2840e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rockspec/nats-0.0.4-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies = {
"lua >= 5.1",
"luasocket",
"lua-cjson",
"uuid"
"uuid >= 1.0.0",
}

build = {
Expand Down
4 changes: 4 additions & 0 deletions src/nats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ local nats = {
local cjson = require('cjson')
local uuid = require('uuid')

-- set the random number generator for /dev/urandom. On Windows this isn't available
-- and it returns nil+error, which is passed on to set_rng which then
-- throws a meaningful error.
uuid.set_rng(uuid.rng.urandom())

-- ### Local properties ###

Expand Down

0 comments on commit fe2840e

Please sign in to comment.