class RandomFactory: (source)
Factory providing secureRandom
and insecureRandom
methods.
You shouldn't have to instantiate this class, use the module level functions instead: it is an implementation detail and could be removed or changed arbitrarily.
Method | insecureRandom |
Return a number of non secure random bytes. |
Method | secureRandom |
Return a number of secure random bytes. |
Class Variable | randomSources |
Undocumented |
Method | _osUrandom |
Wrapper around os.urandom that cleanly manage its absence. |
Method | _randBits |
Wrapper around os.getrandbits. |
Method | _randModule |
Wrapper around the random module. |
Constant | _BYTES |
Undocumented |
Parameters | |
nbytes:int | number of bytes to generate. |
Returns | |
str | a string of random bytes. |