# \[ANN\] stdlib-random 1.2

**URL:** <https://discuss.ocaml.org/t/ann-stdlib-random-1-2/14381>\
**Category:** Community\
**Tags:** announce\
**Created:** [March 29, 2024, 1:47pm UTC](https://discuss.ocaml.org/t/ann-stdlib-random-1-2/14381 "2024-03-29T13:47:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![octachron](https://avatars.discourse-cdn.com/v4/letter/o/49beb7/32.png) [@octachron](https://discuss.ocaml.org/u/octachron)\
**Post date:** [March 29, 2024, 1:47pm UTC](https://discuss.ocaml.org/t/ann-stdlib-random-1-2/14381/1 "2024-03-29T13:47:08Z")

</div>

The library `stdlib-random` is a small compatibility library that provides compiler-independent implementations of the PRNGs used in the history of the standard library `Random`:

- stdlib-random.v3: implement the PRNG used in OCaml 3.07 to 3.11
- stdlib-random.v4: implement the PRNG used in OCaml 3.12 to 4.14
- stdlib-random.v5: implement the PRNG currently used in OCaml 5
- stdlib-random.v5o: implement the PRNG currently used in OCaml 5 in pure OCaml

This library is targeted toward programs that need a deterministic and stable behaviour of the `Random` module across OCaml versions.

The newly released version 1.2.0 updates all implementations to provide the new `int_in_range` function (and its `int32_in_range`, `nativeint_in_range`, `int64_in_range` variants) that will be available in OCaml 5.2.0.

Note however that the implementations on the pre-OCaml 5 PRNGs are not optimal, since I prioritised the maintenance cost over performance, but that could be changed if required.
