commonMain.io.github.katerinapetrova.mpplib.Base64.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mpp-sample-lib-jvm Show documentation
Show all versions of mpp-sample-lib-jvm Show documentation
Sample Kotlin Multiplatform library (jvm + ios + js) test
The newest version!
package io.github.katerinapetrova.mpplib
interface Base64Encoder {
fun encode(src: ByteArray): ByteArray
fun encodeToString(src: ByteArray): String {
val encoded = encode(src)
return buildString(encoded.size) {
encoded.forEach { append(it.toChar()) }
}
}
}
expect object Base64Factory {
fun createEncoder(): Base64Encoder
}