
jvmMain.io.ktor.util.Base64Jvm.kt Maven / Gradle / Ivy
/*
* Copyright 2014-2019 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.util
import java.util.*
/**
* Decode bytes from a BASE64 string [s]
*/
@InternalAPI
fun decodeBase64(s: String): ByteArray = Base64.getDecoder().decode(s)
/**
* Encode [bytes] as a BASE64 string
*/
@InternalAPI
fun encodeBase64(bytes: ByteArray): String = Base64.getEncoder().encodeToString(bytes)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy