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'];
        }
    }