Skip to content

Commit

Permalink
try win ffi generator when generating seed
Browse files Browse the repository at this point in the history
  • Loading branch information
rfl890 authored Oct 8, 2024
1 parent dfba8d5 commit b63847a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/uuid/rng/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,13 @@ do
end
end

do -- try RtlGenRandom() via FFI on windows
local wf = rng.win_ffi()
if wf then
return wf(40) -- this is crypto level, so good enough
end
end

-- fallback to sha1 of a combination of values
local seed = {
unique_table_id,
Expand Down

0 comments on commit b63847a

Please sign in to comment.