By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error

Version 10.2 beta 4 (10P107d)

'withUnsafeBytes' is deprecated: use withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R instead

in file

// String+MD5.swift

extension Kingfisher where Base == String {
    public var md5: String {
        if let data = base.data(using: .utf8, allowLossyConversion: true) {
            var byteBuffer: [UInt8] = []
            data.withUnsafeBytes {
                byteBuffer.append(contentsOf: $0)
            let MD5Calculator = MD5(byteBuffer)
            let MD5Data = MD5Calculator.calculate()
            var MD5String = String()
            for c in MD5Data {
                MD5String += String(format: "%02x", c)
            return MD5String
        } else {
            return base