package mirage-crypto-rng
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
A cryptographically secure PRNG
Install
dune-project
Dependency
Authors
Maintainers
Sources
mirage-crypto-2.3.0.tbz
sha256=840fbf4136605b4a1f1dd5c0611932a274fe3bf97464c82a6b3a9731a68e208e
sha512=8b983bf9e7fc03f3442b9e00f8ec562d6f0ae18702d10a9ca79182e135f85d1c264393d4033c78e51b945dbe4eb7f436a25ccfedeb0c1f9cdb4c46927cd94fbf
doc/src/mirage-crypto-rng.unix/urandom.ml.html
Source file urandom.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29type g = In_channel.t * Mutex.t (* The OCaml runtime always reads at least IO_BUFFER_SIZE from an input channel, which is currently 64 KiB *) let block = 65536 let create ?time:_ () = let ic = In_channel.open_bin "/dev/urandom" and mutex = Mutex.create () in at_exit (fun () -> In_channel.close ic); (ic, mutex) let generate_into ~g:(ic, m) buf ~off len = let finally () = Mutex.unlock m in Mutex.lock m; Fun.protect ~finally (fun () -> match In_channel.really_input ic buf off len with | None -> failwith "couldn't read enough bytes from /dev/urandom" | Some () -> ()) let reseed ~g:_ _data = () let accumulate ~g:_ _source = `Acc (fun _data -> ()) let seeded ~g:_ = true let pools = 0
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>