1
0
Fork 0
forked from fun/fun

Added an OS based random number generator (RNG). (0.37.11)

This commit is contained in:
Johannes Findeisen 2025-12-13 01:14:17 +01:00
commit 87f540797b
12 changed files with 216 additions and 21 deletions

View file

@ -131,6 +131,7 @@ typedef enum {
OP_THREAD_SPAWN, // operand: 0=no args, 1=has args; pops [args?], fn; pushes thread id (int>0)
OP_THREAD_JOIN, // pops thread id; waits; pushes result value (or Nil)
OP_SLEEP_MS, // pops milliseconds; sleeps; pushes Nil (for statement POP safety)
OP_RANDOM_NUMBER, // pops length; pushes hex string of that length from OS RNG (hex-encoded)
// Bitwise (32-bit) and shifts/rotates
OP_BAND, // pops b, a; pushes (uint32_t)(a & b)