public function decode($hash, $type = '')
    {
        if (strlen($hash) !== 11) {
            return false;
        }

        if (!isset($this->_keys[$type])) {
            if ($this->_key === null) {
                $this->_key = $this->crypt->getDerivedKey('secint');
            }

            $this->_keys[$type] = md5($this->_key . $type, true);
        }

        $r = unpack('Vid/Vr', mcrypt_decrypt(MCRYPT_XTEA, $this->_keys[$type], base64_decode($hash . '='), MCRYPT_MODE_ECB));

        if ($r['r'] & 0xFFFF) {
            return false;
        } else {
            return $r['id'];
        }
    }
public function decode($hash, $type = '')
    {
        if (strlen($hash) !== 11) {
            return false;
        }

        if (!isset($this->_keys[$type])) {
            if ($this->_key === null) {
                $this->_key = $this->crypt->getDerivedKey('secint');
            }

            $this->_keys[$type] = md5($this->_key . $type, true);
        }

        $r = unpack('Vid/Vr', mcrypt_decrypt(MCRYPT_XTEA, $this->_keys[$type], base64_decode($hash . '='), MCRYPT_MODE_ECB));

        if ($r['r'] & 0xFFFF) {
            return false;
        } else {
            return $r['id'];
        }
    }
public function decode ( $ hash , $ type = '' ) { if ( strlen ( $ hash ) !== 11 ) { return false ; } if ( ! isset ( $ this -> _keys [ $ type ] ) ) { if ( $ this -> _key === null ) { $ this -> _key = $ this -> crypt -> getDerivedKey ( 'secint' ) ; } $ this -> _keys [ $ type ] = md5 ( $ this -> _key . $ type , true ) ; } $ r = unpack ( 'Vid/Vr' , mcrypt_decrypt ( MCRYPT_XTEA , $ this -> _keys [ $ type ] , base64_decode ( $ hash . '=' ) , MCRYPT_MODE_ECB ) ) ; if ( $ r [ 'r' ] & 0xFFFF ) { return false ; } else { return $ r [ 'id' ] ; } }
Decodes a hash to the original parameter values.

@param string $hash the hash to decode
@param string $type

@return int|false
Decodes a hash to the original parameter values .