code/libraries/joomlatools/library/user/session/container/metadata.php
public function _createNonce($secret, $timeout = 180)
    {
        if (is_string($secret) == false || strlen($secret) < 10) {
            throw new InvalidArgumentException("Missing valid secret");
        }

        $salt = $this->_createSalt(12);

        $lifetime = time() + $timeout;
        $nonce    = $salt . ':' . $lifetime . ':' . hash_hmac( 'sha1', $salt.$lifetime,  $secret );

        return $nonce;
    }
public function _createNonce($secret, $timeout = 180)
    {
        if (is_string($secret) == false || strlen($secret) < 10) {
            throw new InvalidArgumentException("Missing valid secret");
        }

        $salt = $this->_createSalt(12);

        $lifetime = time() + $timeout;
        $nonce    = $salt . ':' . $lifetime . ':' . hash_hmac( 'sha1', $salt.$lifetime,  $secret );

        return $nonce;
    }
public function _createNonce ( $ secret , $ timeout = 180 ) { if ( is_string ( $ secret ) == false || strlen ( $ secret ) < 10 ) { throw new InvalidArgumentException ( "Missing valid secret" ) ; } $ salt = $ this -> _createSalt ( 12 ) ; $ lifetime = time ( ) + $ timeout ; $ nonce = $ salt . ':' . $ lifetime . ':' . hash_hmac ( 'sha1' , $ salt . $ lifetime , $ secret ) ; return $ nonce ; }
Generate a Nonce.

The generated nonce will contains three parts, separated by a colon. The first part is the individual salt.
The second part is the time until the nonce is valid. The third part is a HMAC hash of the salt, the time, and
a secret value.

@link http://en.wikipedia.org/wiki/Hash-based_message_authentication_code

@param string  $secret  String with at least 10 characters. The same value must be passed to _validateNonce().
@param integer $timeout the time in seconds until the nonce becomes invalid.
@throws \InvalidArgumentException If the secret is not valid.
@return string the generated Nonce.
Generate a Nonce .