Esempio n. 1
0
def _next(bits):
    """
    Return the specified number of random bits (0-32) as an int.
    If no entropy is available, the current thread will block until more
    is retrieved from the blockchain.
    """
    return int(_rshift(unpack(">q",randbytes(8))[0], 48 - bits))
Esempio n. 2
0
def _next(bits):
    """
    Return the specified number of random bits (0-32) as an int.
    If no entropy is available, the current thread will block until more is
    retrieved from the blockchain.
    """
    return int(_rshift(unpack(">q", randbytes(8))[0], 48 - bits))
Esempio n. 3
0
def _u_next(bits):
    """
    Return the specified number of random bits (0-32) as an int.
    If no entropy is available, previous entropy will be re-used.
    """
    return int(_rshift(unpack(">q",u_randbytes(8))[0], 48 - bits))
Esempio n. 4
0
def _u_next(bits):
    """
    Return the specified number of random bits (0-32) as an int.
    If no entropy is available, previous entropy will be re-used.
    """
    return int(_rshift(unpack(">q", u_randbytes(8))[0], 48 - bits))