Did I find the right examples for you? yes no

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)
Returns a securely generated random string.

The default length of 12 with the a-z, A-Z, 0-9 character set returns
a 71-bit value. log_2((26+26+10)^12) =~ 71 bits

        def get_random_string(length=12,
                      allowed_chars='abcdefghijklmnopqrstuvwxyz'
                                    'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'):
    """
    Returns a securely generated random string.

    The default length of 12 with the a-z, A-Z, 0-9 character set returns
    a 71-bit value. log_2((26+26+10)^12) =~ 71 bits
    """
    if not using_sysrandom:
        # This is ugly, and a hack, but it makes things better than
        # the alternative of predictability. This re-seeds the PRNG
        # using a value that is hard for an attacker to predict, every
        # time a random string is required. This may change the
        # properties of the chosen random sequence slightly, but this
        # is better than absolute predictability.
        random.seed(
            sha(
                "%s%s%s" % (
                    random.getstate(),
                    time.time(),
                    SECRET)
                ).digest())
    return ''.join([random.choice(allowed_chars) for i in range(length)])
        


src/p/r/Products.PloneHotfix20121106-1.2/Products/PloneHotfix20121106/random_string.py   Products.PloneHotfix20121106(Download)
    def KeyringGenerateSecret(length=64):
        return django_crypto.get_random_string(length)
    keyring.GenerateSecret = KeyringGenerateSecret
except ImportError:
    pass
    def OpenIdGenerateSecret(length=16):
        return django_crypto.get_random_string(length)
    util.GenerateSecret = OpenIdGenerateSecret
except ImportError:
    pass
def uniqueString(self, userid):
    t = long(time.time() * 1000)
    r = django_crypto.get_random_string(64)
    try:
        a = socket.gethostbyname(socket.gethostname())
    except:
        # if we can't get a network address, just imagine one
        a = django_crypto.get_random_string(64)