eloquent/endec API
Class

Eloquent\Endec\Base64\Base64

class Base64 extends Codec

A codec for the base64 encoding protocol.

Methods

__construct(TransformInterface $encodeTransform = null, TransformInterface $decodeTransform = null)

Construct a new base64 codec.

TransformInterface encodeTransform()

Get the encode transform.

from Codec
TransformInterface decodeTransform()

Get the decode transform.

from Codec
string encode(string $data)

Encode the supplied data.

from Codec
string decode(string $data)

Decode the supplied data.

from Codec
TransformStreamInterface createEncodeStream(integer|null $bufferSize = null)

Create a new encode stream.

from Codec
TransformStreamInterface createDecodeStream(integer|null $bufferSize = null)

Create a new decode stream.

from Codec
static CodecInterface instance()

Get the static instance of this codec.

Details

at line 45
public __construct(TransformInterface $encodeTransform = null, TransformInterface $decodeTransform = null)

Construct a new base64 codec.

Parameters

TransformInterface $encodeTransform The encode transform to use.
TransformInterface $decodeTransform The decode transform to use.

in Codec at line 42
public TransformInterface encodeTransform()

Get the encode transform.

Return Value

TransformInterface The encode transform.

in Codec at line 52
public TransformInterface decodeTransform()

Get the decode transform.

Return Value

TransformInterface The decode transform.

in Codec at line 65
public string encode(string $data)

Encode the supplied data.

Parameters

string $data The data to encode.

Return Value

string The encoded data.

Exceptions

EncodingExceptionInterface If the data cannot be encoded.

in Codec at line 85
public string decode(string $data)

Decode the supplied data.

Parameters

string $data The data to decode.

Return Value

string The decoded data.

Exceptions

EncodingExceptionInterface If the data cannot be decoded.

in Codec at line 104
public TransformStreamInterface createEncodeStream(integer|null $bufferSize = null)

Create a new encode stream.

Parameters

integer|null $bufferSize The buffer size in bytes.

Return Value

TransformStreamInterface The newly created encode stream.

in Codec at line 116
public TransformStreamInterface createDecodeStream(integer|null $bufferSize = null)

Create a new decode stream.

Parameters

integer|null $bufferSize The buffer size in bytes.

Return Value

TransformStreamInterface The newly created decode stream.

at line 30
static public CodecInterface instance()

Get the static instance of this codec.

Return Value

CodecInterface The codec.