mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
Deduplicate random.randbytes
random.randbytes() is now in random.py
This commit is contained in:
1 file changed
-8
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user