Crates.io | jandom |
lib.rs | jandom |
version | 0.3.4 |
source | src |
created_at | 2022-01-19 16:33:22.251634 |
updated_at | 2022-07-27 19:01:03.689254 |
description | Port of java.util.Random |
homepage | |
repository | https://github.com/kallekankaanpaa/jandom |
max_upload_size | |
id | 516837 |
size | 303,916 |
A port of Java java.util.Random
to Rust.
The implementation follows the public API of Java 17 Random. The method signatures have been changed to be more rusty,
for example, nextInt
-> next_i32
, nextDouble
-> next_f64
, nextGaussian
-> next_gaussian
, etc.
Jandom differs from other java Random implementations by having true feature parity, where even the next_gaussian
method returns
same values as the Java equivalent.
Jandom makes use of atomics and Mutex to be thread safe by default.
Example usages can be found in the examples
directory.
If you find any discrepencies between this and the Java implementation, please file a Issue.
The code has been licensed under both MIT and Apache 2.0 to follow the Rust API guidelines.