twisted.python.randbytes.RandomFactory(object) class documentationtwisted.python.randbytes
          View Source
          (View In Hierarchy)
        
      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.
| Class Variable | randomSources | Undocumented | 
| 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 | _randBits | Wrapper around os.getrandbits. | 
  
| Method | _randModule | Wrapper around the random module. | 
  
| Class Variable | _BYTES | Undocumented | 
Return a number of secure random bytes.
| 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) | |
Return a number of non secure random bytes.
| Parameters | nbytes | number of bytes to generate. (type: int) | 
| Returns | a string of random bytes. (type: str) | |