Danger
Nothing here should be used for any security purposes.
Random Numbers¶
This module is imported with:
import toy_crypto.rand
For the most part, the functions here duplicate some utilities from random
, but use the cryptographically secure random number generator from secrets
.
The rand
functions¶
- toy_crypto.rand.randrange(*args: int) int ¶
Like
random.randrange()
, but uses RNG fromsecrets
.
- toy_crypto.rand.shuffle(x: MutableSequence[Any]) None ¶
Like
random.shuffle()
, but uses RNG fromsecrets
.- Parameters:
x (MutableSequence[Any])
- Return type:
None