Francis Mariano
06/06/2022, 3:44 PMFrancis Mariano
06/06/2022, 3:49 PMexpect fun calcCRC32(input: ByteArray): Long
And android code:
actual fun calcCRC32(input : ByteArray) : Long {
val crc32 = CRC32()
crc32.update(input)
return crc32.value
}
I am facing troubles to implement in ios code:
actual fun calcCRC32(input: ByteArray): Long {
return crc32(0, inp, input.size.toUInt()).toLong()
// fun crc32(crc: platform.zlib.uLong /* = kotlin.ULong */,
// buf: kotlinx.cinterop.CValuesRef<platform.zlib.uBytefVar /* = kotlinx.cinterop.UByteVarOf<kotlin.UByte> */>?,
// len: platform.zlib.uInt /* = kotlin.UInt */): platform.zlib.uLong /* = kotlin.ULong */ { /* compiled code */ }
}
The buffer is kotlinx.cinterop.UByteVarOf<kotlin.UByte> type. How can I transform the byteArray for this type?Robert Jaros
06/06/2022, 4:10 PM