def _generate_seed():
    """Generate a new random seed

    The length of the returned string will be a multiple of two, and
    stripped of type specifier "0x" that `hex()` prepends.

    :return str: A random, padded hex value
    """
    x = SystemRandom().randint(0, 32 ** 16 - 1)
    h = hex(x).strip('L')[2:]
    if len(h) % 2:
        h = '0' + h
    return h
dataset/ETHPy150Open CenterForOpenScience/osf.io/website/addons/twofactor/models.py/_generate_seed/original