Hautelook\Phpass\PasswordHash::encode64 PHP Method

encode64() public method

public encode64 ( String $input, integer $count ) : String
$input String
$count integer
return String
    public function encode64($input, $count)
    {
        $output = '';
        $i = 0;
        do {
            $value = ord($input[$i++]);
            $output .= $this->itoa64[$value & 0x3f];
            if ($i < $count) {
                $value |= ord($input[$i]) << 8;
            }
            $output .= $this->itoa64[$value >> 6 & 0x3f];
            if ($i++ >= $count) {
                break;
            }
            if ($i < $count) {
                $value |= ord($input[$i]) << 16;
            }
            $output .= $this->itoa64[$value >> 12 & 0x3f];
            if ($i++ >= $count) {
                break;
            }
            $output .= $this->itoa64[$value >> 18 & 0x3f];
        } while ($i < $count);
        return $output;
    }