ManaPHP\Security\Secint::decode PHP Метод

decode() публичный Метод

Decodes a hash to the original parameter values.
public decode ( string $hash, string $type = '' ) : integer | false
$hash string the hash to decode
$type string
Результат integer | false
    public function decode($hash, $type = '')
    {
        if (strlen($hash) !== 11) {
            return false;
        }
        if (!isset($this->_keys[$type])) {
            $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'];
        }
    }