Skip to content
/ Kase64 Public

Base64 encoder/decoder for Kotlin/Multiplatform. Supports Android, iOS, JavaScript and plain JVM environments.

License

Notifications You must be signed in to change notification settings

saschpe/Kase64

Repository files navigation

Kase64

Kotlin Version Maven Central Build Status License

badge-android badge-ios badge-js badge-jvm badge-linux badge-macos badge-windows

Base64 encoder/decoder for Kotlin/Multiplatform. Supports Android, iOS, Linux, JavaScript, Windows, watchOS, tvOS and plain JVM environments.

Supported encodings

Download

Artifacts are published to Maven Central:

repositories {
    mavenCentral()
}

dependencies {
    implementation("de.peilicke.sascha:kase64:1.2.0")
}

Usage

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"

License

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.