Part of twisted.python.randbytes View Source View In Hierarchy
Factory providing secureRandom
and insecureRandom
methods.
| Instance Variables | randomPool | pool of random data.
(type: randpool.RandomPool
) |
| Class Variables | randomSources | list of file sources used when os.urandom is not available.
(type: tuple
) |
| Method | secureRandom | Return a number of secure random bytes. |
| Method | insecureRandom | Return a number of non secure random bytes. |
| Method | _osUrandom | Wrapper around os.urandom that cleanly manage its
absence.
|
| Method | _fileUrandom | Wrapper around random file sources. |
| Method | _cryptoRandom | Wrapper around Crypo random pool. |
| Method | _randBits | Wrapper around os.getrandbits.
|
| Method | _randRange | Wrapper around random.randrange.
|
Wrapper around random file sources.
This method isn't meant to be call out of the class and could be removed arbitrarily.| Parameters | nbytes | number of bytes to generate.
(type: int.
) |
| fallback | whether the function should fallback on non secure random or not.
Default to false.
(type: bool
) | |
| Returns | a string of random bytes.
(type: str.
) | |
| Parameters | nbytes | number of bytes to generate.
(type: int.
) |
| Returns | a string of random bytes.
(type: str.
) | |