Rotate key for VON anchor: generate new key, submit to ledger, update wallet.
        Raise WalletState if wallet is currently closed.

        :param seed: new seed for ed25519 key pair (default random)
778522
async def reseed(self, seed: str = None) -> None:
        

        LOGGER.debug('BaseAnchor.reseed >>> seed: [SEED]')

        verkey = await self.wallet.reseed_init(seed)
        req_json = await ledger.build_nym_request(
            self.did,
            self.did,
            verkey,
            self.name,
            (await self.get_nym_role()).token())
        await self._sign_submit(req_json)
        await self.wallet.reseed_apply()

        LOGGER.debug('BaseAnchor.reseed <<<')
724334
def seed_random_state(seed):
    
    if (seed is None) or (isinstance(seed, int)):
        return np.random.RandomState(seed)
    elif isinstance(seed, np.random.RandomState):
        return seed
    raise ValueError("%r can not be used to generate numpy.random.RandomState"
                     " instance" % seed)
1164572
def _seed(self, seed=-1):
        
        if seed != -1:
          self._random = np.random.RandomState(seed)
        else:
          self._random = np.random.RandomState()
598821
private SessionTicketKey deriveKeyFromSeed(String seed) {
        byte[] seedBin = decodeHex(seed);
        byte[] keyName = hkdf(seedBin, salt, NAME_BYTES, SessionTicketKey.NAME_SIZE);
        byte[] aesKey = hkdf(seedBin, salt, AES_BYTES, SessionTicketKey.AES_KEY_SIZE);
        byte[] hmacKey = hkdf(seedBin, salt, HMAC_BYTES, SessionTicketKey.HMAC_KEY_SIZE);
        return new SessionTicketKey(keyName, hmacKey, aesKey);
    }
810583
async def reseed_apply(self) -> DIDInfo:
        

        LOGGER.debug('Wallet.reseed_apply >>>')

        if not self.handle:
            LOGGER.debug('Wallet.reseed_init <!< Wallet %s is closed', self.name)
            raise WalletState('Wallet {} is closed'.format(self.name))

        await did.replace_keys_apply(self.handle, self.did)
        self.verkey = await did.key_for_local_did(self.handle, self.did)
        now = int(time())
        rv = DIDInfo(self.did, self.verkey, {'anchor': True, 'since': now, 'modified': now})
        await did.set_did_metadata(self.handle, self.did, json.dumps(rv.metadata))

        LOGGER.info('Wallet %s set seed hash metadata for DID %s', self.name, self.did)

        LOGGER.debug('Wallet.reseed_apply <<< %s', rv)
        return rv
16578
def _set_seed(self):
        
        if self.flags['SEED'] is not None:
            tf.set_random_seed(self.flags['SEED'])
            np.random.seed(self.flags['SEED'])
97478
def set_seed(seed: int):
    
    random.seed(seed)
    np.random.seed(seed)
    torch.random.manual_seed(seed)
114576
function(seed) {
    if (!values.isNumber(seed)) {
        throw errors.typeErrorFunction('Math.seed', 'number', seed);
    }
    _random = seedrandom(seed);
    return null;
}
1141384
def _random(self, key):
        """"""

        if hasattr(key, "encode"):
            key = key.encode('ascii')

        value = (zlib.crc32(key, self.seed) & MAX_VALUE)

        return value * INV_MAX_VALUE
224446
def set_random_seed(self, seed):
        """"""
        self.config['mc']['seed'] = seed
        np.random.seed(seed)
1179993
function autoseed(seed) {
  try {
    global.crypto.getRandomValues(seed = new Uint8Array(width));
    return tostring(seed);
  } catch (e) {
    return [+new Date, global, global.navigator.plugins,
            global.screen, tostring(pool)];
  }
}
254892
def master_key_from_seed(seed):
        
        S = get_bytes(seed)
        I = hmac.new(b"Bitcoin seed", S, hashlib.sha512).digest()
        Il, Ir = I[:32], I[32:]
        parse_Il = int.from_bytes(Il, 'big')
        if parse_Il == 0 or parse_Il >= bitcoin_curve.n:
            raise ValueError("Bad seed, resulting in invalid key!")

        return HDPrivateKey(key=parse_Il, chain_code=Ir, index=0, depth=0)
502801
function (mode, scope, callback) {
    var executeSeed = load('seed');
    if (scope) {
      this.internals.migrationMode = scope;
      this.internals.matching = scope;
    }

    this.internals.mode = mode || 'vc';
    return Promise.fromCallback(
      function (callback) {
        executeSeed(this.internals, this.config, callback);
      }.bind(this)
    ).asCallback(callback);
  }
1349653
public Random getNewRandomInstance(long seed) {
        try {
            Random t = (Random) randomClass.newInstance();
            if (t.getStatePointer() != null) {
                // TODO: attach this thing to deallocator
                // if it's stateless random - we just don't care then
            }
            t.setSeed(seed);
            return t;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
412685
synchronized public void setSeed(final long seed)
        {
        // Due to a bug in java.util.Random clear up to 1.2, we're
        // doing our own Gaussian variable.
        __haveNextNextGaussian = false;

        mt = new int[N];
        
        mag01 = new int[2];
        mag01[0] = 0x0;
        mag01[1] = MATRIX_A;

        mt[0]= (int)(seed & 0xffffffff);
        for (mti=1; mti<N; mti++) 
            {
            mt[mti] = 
                (1812433253 * (mt[mti-1] ^ (mt[mti-1] >>> 30)) + mti); 
            /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
            /* In the previous versions, MSBs of the seed affect   */
            /* only MSBs of the array mt[].                        */
            /* 2002/01/09 modified by Makoto Matsumoto             */
            mt[mti] &= 0xffffffff;
            /* for >32 bit machines */
            }
        }
146282
def pbkdf2(seed: str or bytes, dk_len: int) -> bytes:
    
    key = b''
    index = 1
    bytes_seed = str_to_bytes(seed)
    while len(key) < dk_len:
        key += Digest.sha256(b''.join([bytes_seed, index.to_bytes(4, 'big', signed=True)]))
        index += 1
    return key[:dk_len]
1124522
def seed(data, entropy=None):
    
    if not isinstance(data, bintype):
        raise TypeError("A string is expected")
    ptr = c_char_p(data)
    size = len(data)
    if entropy is None:
        libcrypto.RAND_seed(ptr, size)
    else:
        libcrypto.RAND_add(ptr, size, entropy)