It might seem simple at first, but considering that we cannot use the java.util package in the common module of a Kotlin Multiplatform project, I am wondering how to decode a base64 string using pure Kotlin code.
Already tried:
- using expect/actual methods: works fine for Android, but did not work for iOS! It seems like the Swift methods and classes that are for Base64 decoding cannot be used in the kmm module!
- using Ktor's Base64 decoding methods: The Ktor Base64 decoder seems to be an internal Ktor API which I could not use in my KMM project.
I also mentioned that it is marked as deprecated for version
1.4.1in the ktor docs.
I was wondering if there are any other workarounds to decode a Base64 string in a kmm common module.