commit | 6682ab449a1d4ff3917a3d808a0f3e7ad31af6b5 | [log] [tgz] |
---|---|---|
author | easoncylee <[email protected]> | Tue Jul 06 08:16:09 2021 +0000 |
committer | Automerger Merge Worker <[email protected]> | Tue Jul 06 08:16:09 2021 +0000 |
tree | 80f678aead2e8020cabb49c9e783297bd49560da | |
parent | bf809c9c421c9a762a438e6ce7d85e155c5e158f [diff] | |
parent | 1a89bbdf081674372b9fb0d5634ebd53b61aa4f3 [diff] |
Update vpnprofilestore_test to legacykeystore_test in TEST_MAPPING am: 97c556068a am: 1a89bbdf08 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/getrandom/+/1756254 Change-Id: Id0d155c8d5aa2aeda96259af3f9dfcf21168fda7
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.