MCPcopy Create free account
hub / github.com/cosdata/cosdata / random_bytes

Function random_bytes

src/models/crypto.rs:166–171  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

164 use super::*;
165
166 fn random_bytes() -> [u8; 32] {
167 let rng = SystemRandom::new();
168 let mut key = [0u8; 32];
169 rng.fill(&mut key).unwrap();
170 key
171 }
172
173 #[test]
174 fn test_single_step_and_double_step_hashing_consistency() {

Calls

no outgoing calls