private static function _unpad($text, $blocksize) {
        if (empty($text)) {
            return '';
        }
        if (strlen($text) % $blocksize !== 0) {
            return false;
        }
        $pad = ord($text{strlen($text)-1});
        if ($pad > $blocksize || $pad > strlen($text) || $pad === 0) {
            return false;
        }
        if (strspn($text, chr($pad), strlen($text) - $pad) != $pad) {
            return false;
        }
        $textNoPadding = substr($text, 0, - $pad); 
        return $textNoPadding;
    }