package random

  1. Overview
  2. Docs
Easy to use, cryptographically safe random data

Install

Dune Dependency

Authors

Maintainers

Sources

random-0.0.1.tbz
sha256=c8373956a728671d22ab4b7674574d6eb6cc67e2f8843a519d65b6fa37dcbdbb
sha512=1a584e7bee8ebe95960804378acb5487e4596bcf895acd080192168172be0aeca5ddc9120bbb44f8e853917b9a42c202e881d90e3d5b09389cd618fadbd2d178

Description

Tags

random random data

Published: 19 Feb 2024

README

random

Easy to use, cryptographically safe random data generators. Just call Random.<type>:

let size = 2112

(* random numbers *)
let random_int8 = Random.int8 ()
let random_int16 = Random.int16 ()
let random_int32 = Random.int32 ()
let random_int64 = Random.int64 ()
let random_int_up_to_2112 = Random.int ~max:2112
let random_float_up_to_69_420 = Random.float ~max:69.420

(* random strings and chars *)
let random_char = Random.char ()
let random_alpha_num = Random.alphanum ()
let random_string = Random.string size
let random_bytes = Random.bytes size

(* sequences *)
let infinite_number_sequence = Random.(seq int)
let infinite_char_sequence = Random.(seq char)

(* lists *)
let list_of_10_ints = Random.(list int 10)

Dependencies (5)

  1. dune >= "3.14"
  2. randomconv >= "0.1.3" & < "0.2.0"
  3. ocaml >= "4.14.0"
  4. mirage-crypto-rng >= "0.11.2" & < "1.0.0"
  5. mirage-crypto >= "0.11.2" & < "1.0.0"

Dev Dependencies (1)

  1. odoc with-doc

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.