commit | 682e64bdcf9b087cb5ff119a53862492b865ff10 | [log] [tgz] |
---|---|---|
author | Victor Hsieh <victorhsieh@google.com> | Tue Dec 15 13:48:22 2020 -0800 |
committer | Victor Hsieh <victorhsieh@google.com> | Tue Dec 15 14:28:41 2020 -0800 |
tree | e7698ae7a4dc03ca371d28d969fdacf068302d0c | |
parent | 3711f35afb45ebe3788a43b94c8396a0dc79d901 [diff] |
Import rand_xorshift from crates.io This is generated with get_rust_pkg.py, plus: - Android.bp with a patch to remove unused library bincode - TEST_MAPPING Test: mma Bug: 174797066 Change-Id: I769b3c36bf9f4d27253d5fb9cd91eb2821704be8
Implements the Xorshift random number generator.
The Xorshift[^1] algorithm is not suitable for cryptographic purposes but is very fast. If you do not know for sure that it fits your requirements, use a more secure one such as StdRng
or OsRng
.
[^1]: Marsaglia, George (July 2003). "Xorshift RNGs". Journal of Statistical Software. Vol. 8 (Issue 14).
Links:
rand_xorshift
is no_std
compatible. It does not require any functionality outside of the core
lib, thus there are no features to configure.
The serde1
feature includes implementations of Serialize
and Deserialize
for the included RNGs.
rand_xorshift
is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See LICENSE-APACHE and LICENSE-MIT, and COPYRIGHT for details.