private function encode($seed, $format = null)
    {
        $encoder = $this->encoder;

        if ($format == self::FORMAT_HEX) {
            $encoder = new HexEncoder();
        } elseif ($format == self::FORMAT_BASE32) {
            $encoder = new Base32Encoder();
        } elseif ($format == self::FORMAT_RAW) {
            $encoder = new RawEncoder();
        }

        $output = $encoder->encode($seed);

        return $output;
    }
private function encode($seed, $format = null)
    {
        $encoder = $this->encoder;

        if ($format == self::FORMAT_HEX) {
            $encoder = new HexEncoder();
        } elseif ($format == self::FORMAT_BASE32) {
            $encoder = new Base32Encoder();
        } elseif ($format == self::FORMAT_RAW) {
            $encoder = new RawEncoder();
        }

        $output = $encoder->encode($seed);

        return $output;
    }
private function encode ( $ seed , $ format = null ) { $ encoder = $ this -> encoder ; if ( $ format == self :: FORMAT_HEX ) { $ encoder = new HexEncoder ( ) ; } elseif ( $ format == self :: FORMAT_BASE32 ) { $ encoder = new Base32Encoder ( ) ; } elseif ( $ format == self :: FORMAT_RAW ) { $ encoder = new RawEncoder ( ) ; } $ output = $ encoder -> encode ( $ seed ) ; return $ output ; }
Attempt to encode a seed value

@param  string  $seed   The seed value.
@param  string  $format Optional; target encode format. If not provided,
default format is assumed.
@return string  Returns the encoded seed value.
Attempt to encode a seed value