How to use crc32 from zlib in swift (Xcode 9)

我是研究僧i 提交于 2019-12-23 17:38:17

问题


I'm new to swift/xcode and am trying to use the crc32 function that, as mentioned here, is provided in zlib from libz.dylib .

I've modified the code so that I am now trying:

let message1 = "some message".first?.value!.data(using: String.Encoding.utf8, allowLossyConversion: false) let crc = crc32(CLong(0), UnsafePointer<Bytef>(strcat!.bytes), UInt(message1!.length))

however I am encountering the error: use of unresolved identifier 'crc32'.

Could anyone help me to figure out what step I might be missing in trying to use the crc32 function?

Thanks!

来源:https://stackoverflow.com/questions/49072759/how-to-use-crc32-from-zlib-in-swift-xcode-9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!