Base64 encoder/decoder for Kotlin/Multiplatform. Supports Android, iOS, Linux, JavaScript, Windows, watchOS, tvOS and plain JVM environments.
Supported encodings
Artifacts are published to Maven Central:
repositories {
mavenCentral()
}
dependencies {
implementation("de.peilicke.sascha:kase64:1.2.0")
}
Standard Base64 decoding and encoding:
import saschpe.kase64.*
val helloWorld = "SGVsbG8sIHdvcmxkIQ==".base64Decoded // "Hello, world!"
println("Hello, world!".base64Encoded) // Prints "SGVsbG8sIHdvcmxkIQ=="
URL-safe Base64 decoding and encoding:
import saschpe.kase64.*
val helloWorld = "SGVsbG8sIHdvcmxkIQ".base64UrlDecoded // "Hello, world!"
println("Hello, world!".base64UrlEncoded) // Prints "SGVsbG8sIHdvcmxkIQ"
Copyright 2022 Sascha Peilicke
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.