Base64

expect object Base64 : Encoder

Cross-platform utilities for encoding and decoding to/from Base64.

actual object Base64 : Encoder

Cross-platform utilities for encoding and decoding to/from Base64.

Functions

Link copied to clipboard
expect open override fun decode(data: ByteArray): ByteArray

Decode the provided data from Base64, returning a raw set of bytes resulting from the decoding operation.

expect open override fun decode(string: String): ByteArray

Decode the provided string from Base64, returning a raw set of bytes resulting from the decoding operation.

actual open override fun decode(data: ByteArray): ByteArray

Decode the provided data from Base64, returning a raw set of bytes resulting from the decoding operation.

actual open override fun decode(string: String): ByteArray

Decode the provided string from Base64, returning a raw set of bytes resulting from the decoding operation.

Link copied to clipboard
expect open override fun decodeToString(data: ByteArray): String

Decode the provided data from Base64, returning a regular string value, encoded as UTF-8.

expect open override fun decodeToString(string: String): String

Decode the provided string from Base64, returning a regular string value, encoded as UTF-8.

actual open override fun decodeToString(data: ByteArray): String

Decode the provided data from Base64, returning a regular string value, encoded as UTF-8.

actual open override fun decodeToString(string: String): String

Decode the provided string from Base64, returning a regular string value, encoded as UTF-8.

Link copied to clipboard
expect open override fun encode(data: ByteArray): ByteArray

Encode the provided data into a Base64-encoded set of bytes, which includes padding if necessary.

expect open override fun encode(string: String): ByteArray

Encode the provided string into a Base64-encoded byte array, which includes padding if necessary.

actual open override fun encode(data: ByteArray): ByteArray

Encode the provided data into a Base64-encoded set of bytes, which includes padding if necessary.

actual open override fun encode(string: String): ByteArray

Encode the provided string into a Base64-encoded string, which includes padding if necessary.

Link copied to clipboard
expect open override fun encodeToString(data: ByteArray): String

Encode the provided data into a Base64-encoded string, which includes padding if necessary.

expect open override fun encodeToString(string: String): String

Encode the provided string into a Base64-encoded string, which includes padding if necessary.

actual open override fun encodeToString(data: ByteArray): String

Encode the provided data into a Base64-encoded string, which includes padding if necessary.

actual open override fun encodeToString(string: String): String

Encode the provided string into a Base64-encoded string, which includes padding if necessary.

Link copied to clipboard
expect fun encodeWebSafe(data: ByteArray): ByteArray

Encode the provided data into a Base64-encoded set of bytes, omitting characters which are unsafe for use on the web, including padding characters, which are not emitted.

expect fun encodeWebSafe(string: String): String

Encode the provided string into a Base64-encoded string, omitting characters which are unsafe for use on the web, including padding characters, which are not emitted.

actual fun encodeWebSafe(data: ByteArray): ByteArray

Encode the provided data into a Base64-encoded set of bytes, omitting characters which are unsafe for use on the web, including padding characters, which are not emitted.

actual fun encodeWebSafe(string: String): String

Encode the provided string into a Base64-encoded string, omitting characters which are unsafe for use on the web, including padding characters, which are not emitted.

Link copied to clipboard
expect open override fun encoding(): Encoding

Return the enumerated Encoding which is implemented by this Encoder.

actual open override fun encoding(): Encoding

Return the enumerated Encoding which is implemented by this Encoder.