commit | ace1cb2ce2a9b22a0f1d98c511b78d3b87e12ac6 | [log] [tgz] |
---|---|---|
author | Jeff Vander Stoep <[email protected]> | Tue Jan 31 19:34:29 2023 +0000 |
committer | Automerger Merge Worker <[email protected]> | Tue Jan 31 19:34:29 2023 +0000 |
tree | b8f94bacd79df2b4360c070d2a702aee5abcb2a8 | |
parent | 8c8ece2b15fde7f0f2fb697cd02f7f9719bc4fd8 [diff] | |
parent | 07b355a77e8b953059130fe477ecb2871457dd84 [diff] |
Update TEST_MAPPING am: 07b355a77e Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/getrandom/+/2411486 Change-Id: Ifd915dc20aa2a77e7e28945f58721cb79b0f0864 Signed-off-by: Automerger Merge Worker <[email protected]>
A Rust library for retrieving random data from (operating) system source. It is assumed that system always provides high-quality cryptographically secure random data, ideally backed by hardware entropy sources. This crate derives its name from Linux‘s getrandom
function, but is cross platform, roughly supporting the same set of platforms as Rust’s std
lib.
This is a low-level API. Most users should prefer using high-level random-number library like rand
.
Add this to your Cargo.toml
:
[dependencies] getrandom = "0.2"
Then invoke the getrandom
function:
fn get_random_buf() -> Result<[u8; 32], getrandom::Error> { let mut buf = [0u8; 32]; getrandom::getrandom(&mut buf)?; Ok(buf) }
For more information about supported targets, entropy sources, no_std
targets, crate features, WASM support and Custom RNGs see the getrandom
documentation and getrandom::Error
documentation.
This crate requires Rust 1.34.0 or later.
The getrandom
library is distributed under either of
at your option.