bytes->encodeBase64

Base64 encodes bytes.

Target member

Signature

1bytes->encodeBase64()

Base64 encodes bytes.

bytes->encodeBase64 is called with member syntax on a receiver value. bytes->encodeBase64 works with binary values. Convert strings to bytes before byte-level hashing or encoding, then convert back to a string only for display or transport.

Examples

Basic call

1bytes('secret')->encodeBase64->asString
The example keeps binary work on bytes and converts only when text output is needed.