securerandom.lua 541 B

123456789101112131415161718192021
  1. ---@meta
  2. ---SecureRandom
  3. ---------------
  4. -- Crypto-secure PRNG constructor.
  5. --
  6. -- Returns `nil` if a secure random device cannot be found on the system.
  7. ---@return mt.SecureRandom|nil
  8. function SecureRandom() end
  9. -- Interface for the operating system's crypto-secure PRNG.
  10. --
  11. -- It can be created via `SecureRandom()`.
  12. ---@class mt.SecureRandom
  13. local SecureRandomClass
  14. -- Return next `count`.
  15. ---@param count number|nil Many random bytes. Default 1, capped at 2048.
  16. ---@return string count
  17. function SecureRandomClass:next_bytes(count) end