2020-10-23 17:22:10 -07:00
|
|
|
pub use solana_program::hash::*;
|
2018-03-29 12:20:54 -06:00
|
|
|
|
2020-10-19 13:19:24 -07:00
|
|
|
/// random hash value for tests and benchmarks.
|
2020-10-24 08:39:28 -07:00
|
|
|
#[cfg(feature = "full")]
|
2020-10-19 11:27:59 -07:00
|
|
|
pub fn new_rand<R: ?Sized>(rng: &mut R) -> Hash
|
|
|
|
where
|
|
|
|
R: rand::Rng,
|
|
|
|
{
|
|
|
|
let mut buf = [0u8; HASH_BYTES];
|
|
|
|
rng.fill(&mut buf);
|
|
|
|
Hash::new(&buf)
|
|
|
|
}
|