commit | c08b7c08bc49851b7fe6ba5a9299a478d690f957 | [log] [tgz] |
---|---|---|
author | David Brazdil <[email protected]> | Tue Jan 24 18:55:34 2023 +0000 |
committer | Automerger Merge Worker <[email protected]> | Tue Jan 24 18:55:34 2023 +0000 |
tree | 2c325a19ba8847cca7c19cbda7287ce2a22bb88d | |
parent | 37410dce366e5f0eab0a7fed935cd26c65494e75 [diff] | |
parent | 6fefe07534f34c6b670379e2ae210acbc53e9b75 [diff] |
Update TEST_MAPPING am: aff191e298 am: 8c8ece2b15 am: 6fefe07534 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/getrandom/+/2399011 Change-Id: I6f227860563b4f12dd267673502539fc29a52610 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.