Generates a random :class:`~SigningKey` object.

        :rtype: :class:`~SigningKey`
426452
def generate(cls):
        
        return cls(
            libnacl.randombytes(libnacl.crypto_sign_SEEDBYTES),
            encoder=encoding.RawEncoder,
        )
613952
def random_id_generator(self, size=6, chars=string.ascii_uppercase +
                            string.digits):
        '''  '''
        return ''.join(random.choice(chars) for x in range(size))
776093
def from_credentials(cls: Type[SigningKeyType], salt: Union[str, bytes], password: Union[str, bytes],
                         scrypt_params: Optional[ScryptParams] = None) -> SigningKeyType:
        
        if scrypt_params is None:
            scrypt_params = ScryptParams()

        salt = ensure_bytes(salt)
        password = ensure_bytes(password)
        seed = scrypt(password, salt, scrypt_params.N, scrypt_params.r, scrypt_params.p, scrypt_params.seed_length)

        return cls(seed)
781567
def refill_random(self):
        '''  '''
        self.random_umis = np.random.choice(
            list(self.umis.keys()), self.random_fill_size, p=self.prob)
        self.random_ix = 0
1370773
def crypto_sign_keypair(seed=None):
    """"""
    if seed is None:
        seed = os.urandom(PUBLICKEYBYTES)
    else:
        warnings.warn("ed25519ll should choose random seed.",
                      RuntimeWarning)
    if len(seed) != 32:
        raise ValueError("seed must be 32 random bytes or None.")
    skbytes = seed
    vkbytes = djbec.publickey(skbytes)
    return Keypair(vkbytes, skbytes+vkbytes)
130203
def random(count: 1)
      list = self.connection.srandmember(@key, count)

      return nil if list.nil?
      return count == 1 ? list[0] : ::Set.new(list)
    end
201020
def generate_token(self, *args, **kwargs):
        
        # determine the length based on min_length and max_length
        length = random.randint(self.min_length, self.max_length)

        # generate the token using os.urandom and hexlify
        return binascii.hexlify(
            os.urandom(self.max_length)
        ).decode()[0:length]
833291
def random_letter(self):
        """"""
        return self.generator.random.choice(
            getattr(string, 'letters', string.ascii_letters))
1019784
def create_key_pair(self, cert_type, bits):
        

        pkey = crypto.PKey()
        pkey.generate_key(cert_type, bits)
        return pkey
547047
def random(self):
        
        return '#' + random.randrange(256).encode('hex') + \
               random.randrange(256).encode('hex') + random.randrange(256).encode('hex')
384192
def generate_nonce():
        
        nonce = ''.join([str(randint(0, 9)) for i in range(8)])
        return HMAC(
            nonce.encode(),
            "secret".encode(),
            sha1
        ).hexdigest()
700249
def generate_key(self, email):
        
        salt = sha1(str(random())).hexdigest()[:5]
        return sha1(salt + email).hexdigest()
1250953
def generate_key(key_length=64):
    
    if hasattr(random, 'SystemRandom'):
        logging.info('Generating a secure random key using SystemRandom.')
        choice = random.SystemRandom().choice
    else:
        msg = "WARNING: SystemRandom not present. Generating a random "\
              "key using random.choice (NOT CRYPTOGRAPHICALLY SECURE)."
        logging.warning(msg)
        choice = random.choice
    return ''.join(map(lambda x: choice(string.digits + string.ascii_letters),
                   range(key_length)))
220737
def random(self, n: Optional[int] = None) -> Union[List[float], float]:
        
        return self._generate_randoms(self._request_randoms, max_n=self.config.MAX_NUMBER_OF_FLOATS,
                                      n=n)
939842
def random_new(algo: int = RNG_CMWC) -> tcod.random.Random:
    
    return tcod.random.Random(algo)
105246
def CreateKey(self, private_key=None):
        
        if private_key is None:
            private_key = bytes(Random.get_random_bytes(32))

        key = KeyPair(priv_key=private_key)
        self._keys[key.PublicKeyHash.ToBytes()] = key
        return key
454481
def generate(self, verified, keygen):
        
        return Verification(
            verified_entity=verified,
            key=keygen(),
            verified=False
        )