Hello guys,
I need your help
I'm building kmm application and part of the api call is md5 hash key, I made the implementation for android part but for iOS I couldn't use CryptoKit because it's pure swift and using the CoreCrypto I faced a lot of trouble converting the swift code to kotlin
this is the contract:
Copy code
expect object EncryptionHelper {
fun md5(input: String): String
}
this is the Android part:
Copy code
import java.math.BigInteger
import java.security.MessageDigest
actual object EncryptionHelper {
actual fun md5(input: String): String {
val md = MessageDigest.getInstance("MD5")
return BigInteger(1, md.digest(input.toByteArray())).toString(16).padStart(32, '0')
}
}