Package Crypto :: Package Random :: Module random :: Class StrongRandom
[hide private]
[frames] | no frames]

Class StrongRandom

object --+
         |
        StrongRandom

Instance Methods [hide private]
 
__init__(self, rng=None, randfunc=None)
x.__init__(...) initializes x; see help(type(x)) for signature
 
getrandbits(self, k)
Return a python long integer with k random bits.
 
randrange(self, *args)
randrange([start,] stop[, step]): Return a randomly-selected element from range(start, stop, step).
 
randint(self, a, b)
Return a random integer N such that a <= N <= b.
 
choice(self, seq)
Return a random element from a (non-empty) sequence.
 
shuffle(self, x)
Shuffle the sequence in place.
 
sample(self, population, k)
Return a k-length list of unique elements chosen from the population sequence.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, rng=None, randfunc=None)
(Constructor)

 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)

choice(self, seq)

 

Return a random element from a (non-empty) sequence.

If the seqence is empty, raises IndexError.