package ttweetnacl

  1. Overview
  2. Docs

Entropy gathering (from the OS).

val gather : int -> Bytes.t

gather n gathers n bytes of entropy from your operating system. The function blocks until enough entropy is gathered.

The maximal n that can be used is platform dependent and Sys_error is raised if the request cannot be satisfied. However, using no more than 256 bytes should be safe.

This does:

Raises Sys_error in case of problem. If this happen do not try to handle the exception, log it at the toplevel of your program and abort the program. It likely indicates a serious error condition in the system.

OCaml

Innovation. Community. Security.