Skip to content

Commit

Permalink
Added typealias and link to original source for base64 encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Kantis committed Oct 23, 2022
1 parent 94946e0 commit 6733bb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package io.ks3.standard.base64

import kotlinx.serialization.KSerializer
import kotlinx.serialization.Serializable
import kotlinx.serialization.descriptors.PrimitiveKind
import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder

typealias ByteArrayAsBase64String = @Serializable(with = ByteArrayAsBase64StringSerializer::class) ByteArray

object ByteArrayAsBase64StringSerializer : KSerializer<ByteArray> {
override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor(
"io.ks3.standard.base64.ByteArrayAsBase64StringSerializer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package io.ks3.standard.base64

/**
* @author Alexander Y. Kleymenov
* @author Emil Kantis
* https://github.com/square/okio/blob/master/okio/src/commonMain/kotlin/okio/-Base64.kt
*/

internal const val BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
Expand Down

0 comments on commit 6733bb2

Please sign in to comment.