Deduplicate random.randbytes

random.randbytes() is now in random.py
This commit is contained in:
Padraic Fanning committed 2022-01-16 16:18:06 -05:00
1 parent e766513ad3
commit 6b795a7e49
1 file changed
-8
-8
View File
@@ -149,13 +149,5 @@ mod _random {
};
Ok(BigInt::from_biguint(sign, uint))
}
#[pymethod]
fn randbytes(&self, n: usize) -> PyResult<Vec<u8>> {
let mut buf = vec![0u8; n];
let mut rng = self.rng.lock();
rng.fill_bytes(&mut buf);
Ok(buf)
}
}
}