How do you encode and decode Base64 in common code...
# multiplatform
i
How do you encode and decode Base64 in common code? Looks like this contains in ktor, but it is marked as InternalApi
Also i’d found any gist but somewhy i do not trust them fully
a
On latest main branch of ktor it isn't internal https://github.com/ktorio/ktor/blob/main/ktor-utils/common/src/io/ktor/util/Base64.kt Although I'm not sure if its published like this.
n
In the KMM Native documentation, the exemple of expect / actual is the base64 case. https://kotlinlang.org/docs/multiplatform-library.html#native
👍 1
i
But still internal in last stable 1.6.8 version
a
But still internal in last stable 1.6.8 version
True, but I think you can still use it, can't you?
i
True, but I think you can still use it, can’t you?
¯\_(ツ)_/¯
m
👍 2
🦜 1
1
h
I still don't get it, why it's not in std lib.
2
m
It's interesting to have it bound to an I/O library so that you can encode/decode without having to hold all your data in RAM
y
I feel like Okio is missing standard lib for KMP
d
@Anton Lakotka [JB] Devs shy away from
internal
methods because they aren't generally guaranteed to be non-changing in their implementation.