Returns the nonce value if found, NULL otherwise.

@param type $nonce

@return NULL|int
558274
protected function readNonceValue($nonce)
    {
        $value = null;

        if (null === $this->registryRepository) {
            if (true === is_readable($this->nonceDir.DIRECTORY_SEPARATOR.$nonce)) {
                $value = file_get_contents($this->nonceDir.DIRECTORY_SEPARATOR.$nonce);
            }
        } else {
            $value = $this->getRegistry($nonce)->getValue();
        }

        if (null !== $value) {
            $value = explode(';', $value);
        }

        return $value;
    }
686659
protected function getOauthParams($timestamp, $nonce)
    {
        $params = new Collection(array(
            'oauth_consumer_key'     => $this->config['consumer_key'],
            'oauth_nonce'            => $nonce,
            'oauth_signature_method' => $this->config['signature_method'],
            'oauth_timestamp'        => $timestamp,
        ));

        // Optional parameters should not be set if they have not been set in the config as
        // the parameter may be considered invalid by the Oauth service.
        $optionalParams = array(
            'callback'  => 'oauth_callback',
            'token'     => 'oauth_token',
            'verifier'  => 'oauth_verifier',
            'version'   => 'oauth_version'
        );

        foreach ($optionalParams as $optionName => $oauthName) {
            if (isset($this->config[$optionName]) == true) {
                $params[$oauthName] = $this->config[$optionName];
            }
        }

        return $params;
    }
453098
private function getOauthParams($nonce, array $config)
    {
        $params = [
            'oauth_consumer_key'     => $config['consumer_key'],
            'oauth_nonce'            => $nonce,
            'oauth_signature_method' => $config['signature_method'],
            'oauth_timestamp'        => time(),
        ];

        // Optional parameters should not be set if they have not been set in
        // the config as the parameter may be considered invalid by the Oauth
        // service.
        $optionalParams = [
            'callback'  => 'oauth_callback',
            'token'     => 'oauth_token',
            'verifier'  => 'oauth_verifier',
            'version'   => 'oauth_version'
        ];

        foreach ($optionalParams as $optionName => $oauthName) {
            if (isset($config[$optionName])) {
                $params[$oauthName] = $config[$optionName];
            }
        }

        return $params;
    }
338584
protected function generateNonce()
    {
        $expiryTime = microtime(true) + $this->getConfig('nonceLifetime');
        $secret = $this->getConfig('secret');
        $signatureValue = hash_hmac('sha1', $expiryTime . ':' . $secret, $secret);
        $nonceValue = $expiryTime . ':' . $signatureValue;

        return base64_encode($nonceValue);
    }
1358760
protected function getValue($key)
    {
        foreach ($this->bags as $bag) {
            if (!$bag->has($key)) {
                continue;
            }
            
            if ($bag instanceof ParameterBag) {
                $value = $bag->get($key);
            }
            elseif ($bag instanceof HeaderBag) {
                // when header is presented only once, string value is returned, otherwise, array value is returned
                $value = $bag->get($key, null, false);
                if (is_array($value)) {
                    if (count($value) == 1) {
                        $value = $value[0];
                    }
                    elseif (count($value) == 0) {
                        $value = null;
                    }
                    /** @noinspection PhpStatementHasEmptyBodyInspection */
                    else {
                        // $value = $value;
                    }
                }
            }
            else {
                throw new \LogicException("Bag type invalid!");
            }
            
            return $value;
        }
        
        return null;
    }
198381
public function &offsetGet($key) {
        if(!$this->offsetExists($key)) {
            throw new KeyNotFoundException($key);
        }
        return $this->table[$key]->getValue();
    }
985456
public function checkSignature($signature = null, $timestamp = null, $nonce = null)
    {
        $request = Yii::$app->request;
        $signature === null && $signature = $request->get('signature', '');
        $timestamp === null && $timestamp = $request->get('timestamp', '');
        $nonce === null && $nonce = $request->get('nonce', '');
        $tmpArr = [$this->token, $timestamp, $nonce];
        sort($tmpArr, SORT_STRING);
        $tmpStr = implode($tmpArr);
        return sha1($tmpStr) == $signature;
    }
1193117
public function createNonce()
    {
        $secret  = $this->getSecret();
        $timeout = $this->getLifetime();

        $nonce = $this->_createNonce($secret, $timeout);
        $this->nonces[$nonce] = $nonce;

        return $nonce;
    }
545793
public static function getAuthKey($username, $password, $nonce)
    {
        return md5($nonce . $username . md5($username . ':mongo:' . $password));
    }
947715
public function findByNome($nome)
    {
        $rowset = $this->getTableGateway()->select(function (Select $select) use($nome) {
            $select->columns($this->columns)
            ->where(array(
                'nome' => $nome
            ))
            ->limit(1);
        });
        $row = $rowset->current();
        if (! $row) {
            return NULL;
        }
        return $row;
    }
396869
public function loadConsumerNonce($nonce)
    {

        $ok = true;

// Delete any expired nonce values
        $now = date("{$this->dateFormat} {$this->timeFormat}", time());
        $sql = "DELETE FROM {$this->dbTableNamePrefix}" . DataConnector::NONCE_TABLE_NAME . ' WHERE expires <= :now';
        $query = $this->db->prepare($sql);
        $query->bindValue('now', $now, PDO::PARAM_STR);
        $query->execute();

// Load the nonce
        $id = $nonce->getConsumer()->getRecordId();
        $value = $nonce->getValue();
        $sql = "SELECT value T FROM {$this->dbTableNamePrefix}" . DataConnector::NONCE_TABLE_NAME . ' WHERE (consumer_pk = :id) AND (value = :value)';
        $query = $this->db->prepare($sql);
        $query->bindValue('id', $id, PDO::PARAM_INT);
        $query->bindValue('value', $value, PDO::PARAM_STR);
        $ok = $query->execute();
        if ($ok) {
            $row = $query->fetch(PDO::FETCH_ASSOC);
            if ($row === false) {
                $ok = false;
            }
        }

        return $ok;

    }
252693
async function getAccountNonce (accountId, nonce) {
  if (nonce) return nonce
  const { nonce: accountNonce } = await this.api.getAccountByPubkey(accountId).catch(() => ({ nonce: 0 }))
  return accountNonce + 1
}
522064
protected function generateNonce()
    {
        $nonce = '';
        for ($i = 0; $i < 64; $i++) {
            // append random ASCII character
            $nonce .= chr(mt_rand(33, 126));
        }

        return base64_encode($nonce);
    }
41147
public function saveConsumerNonce($nonce)
    {

        $id = $nonce->getConsumer()->getRecordId();
        $value = $nonce->getValue();
        $expires = date("{$this->dateFormat} {$this->timeFormat}", $nonce->expires);
        $sql = "INSERT INTO {$this->dbTableNamePrefix}" . DataConnector::NONCE_TABLE_NAME . ' (consumer_pk, value, expires) VALUES (:id, :value, :expires)';
        $query = $this->db->prepare($sql);
        $query->bindValue('id', $id, PDO::PARAM_INT);
        $query->bindValue('value', $value, PDO::PARAM_STR);
        $query->bindValue('expires', $expires, PDO::PARAM_STR);
        $ok = $query->execute();

        return $ok;

    }
438531
protected function getNonceSalt()
    {
        // Allow users to set their own nonce
        if (!is_null($this->getConfig('nonce'))) {
            return $this->request->generateNonceKey($this->getConfig('nonce'));
        // Use the entity if it is present
        } elseif (!is_null($this->associatedEntity)) {
            return $this->request->generateNonceKey($this->associatedEntity);
        }

        // Fallback to something custom for the Helper
        return $this->request->generateNonceKey();
    }
391742
public function nonce_field($key = '_wpnonce', $referrer = false, $echo = true){
        return wp_nonce_field($this->action, $key, $referrer, $echo);
    }
715988
private function createNonce()
    {
        if (function_exists('wp_create_nonce')) {
            return wp_create_nonce($this->nonceKey);
        }

        $nonce = md5(microtime(true).$this->nonceKey);
        if (empty($_SESSION['csrf_tokens'])) {
            $_SESSION['csrf_tokens'] = array();
        }
        $_SESSION['csrf_tokens'][$nonce] = true;

        return $nonce;
    }