OpenPGP_S2K::to_bytes PHP Method

to_bytes() public method

public to_bytes ( )
    function to_bytes()
    {
        $bytes = chr($this->type);
        switch ($this->type) {
            case 0:
                $bytes .= chr($this->hash_algorithm);
                break;
            case 1:
                $bytes .= chr($this->hash_algorithm);
                $bytes .= $this->salt;
                break;
            case 3:
                $bytes .= chr($this->hash_algorithm);
                $bytes .= $this->salt;
                $bytes .= chr(OpenPGP::encode_s2k_count($this->count));
                break;
        }
        return $bytes;
    }