function _increment_str(&$var)
    {
        for ($i = 4; $i <= strlen($var); $i+= 4) {
            $temp = substr($var, -$i, 4);
            switch ($temp) {
                case "\xFF\xFF\xFF\xFF":
                    $var = substr_replace($var, "\x00\x00\x00\x00", -$i, 4);
                    break;
                case "\x7F\xFF\xFF\xFF":
                    $var = substr_replace($var, "\x80\x00\x00\x00", -$i, 4);
                    return;
                default:
                    $temp = unpack('Nnum', $temp);
                    $var = substr_replace($var, pack('N', $temp['num'] + 1), -$i, 4);
                    return;
            }
        }

        $remainder = strlen($var) % 4;

        if ($remainder == 0) {
            return;
        }

        $temp = unpack('Nnum', str_pad(substr($var, 0, $remainder), 4, "\0", STR_PAD_LEFT));
        $temp = substr(pack('N', $temp['num'] + 1), -$remainder);
        $var = substr_replace($var, $temp, 0, $remainder);
    }
function _increment_str(&$var)
    {
        for ($i = 4; $i <= strlen($var); $i+= 4) {
            $temp = substr($var, -$i, 4);
            switch ($temp) {
                case "\xFF\xFF\xFF\xFF":
                    $var = substr_replace($var, "\x00\x00\x00\x00", -$i, 4);
                    break;
                case "\x7F\xFF\xFF\xFF":
                    $var = substr_replace($var, "\x80\x00\x00\x00", -$i, 4);
                    return;
                default:
                    $temp = unpack('Nnum', $temp);
                    $var = substr_replace($var, pack('N', $temp['num'] + 1), -$i, 4);
                    return;
            }
        }

        $remainder = strlen($var) % 4;

        if ($remainder == 0) {
            return;
        }

        $temp = unpack('Nnum', str_pad(substr($var, 0, $remainder), 4, "\0", STR_PAD_LEFT));
        $temp = substr(pack('N', $temp['num'] + 1), -$remainder);
        $var = substr_replace($var, $temp, 0, $remainder);
    }
function _increment_str ( & $ var ) { for ( $ i = 4 ; $ i <= strlen ( $ var ) ; $ i += 4 ) { $ temp = substr ( $ var , - $ i , 4 ) ; switch ( $ temp ) { case "\xFF\xFF\xFF\xFF" : $ var = substr_replace ( $ var , "\x00\x00\x00\x00" , - $ i , 4 ) ; break ; case "\x7F\xFF\xFF\xFF" : $ var = substr_replace ( $ var , "\x80\x00\x00\x00" , - $ i , 4 ) ; return ; default : $ temp = unpack ( 'Nnum' , $ temp ) ; $ var = substr_replace ( $ var , pack ( 'N' , $ temp [ 'num' ] + 1 ) , - $ i , 4 ) ; return ; } } $ remainder = strlen ( $ var ) % 4 ; if ( $ remainder == 0 ) { return ; } $ temp = unpack ( 'Nnum' , str_pad ( substr ( $ var , 0 , $ remainder ) , 4 , "\0" , STR_PAD_LEFT ) ) ; $ temp = substr ( pack ( 'N' , $ temp [ 'num' ] + 1 ) , - $ remainder ) ; $ var = substr_replace ( $ var , $ temp , 0 , $ remainder ) ; }
Increment the current string

@see self::decrypt()
@see self::encrypt()
@param string $var
@access private
Increment the current string