Hey guys,
I'm getting the following Warning on my function:
'withUnsafeBytes' is deprecated: use withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R instead
But can't really figure out what is going on:
func hexString(data: Data) -> String {
return data.withUnsafeBytes { (bytes: UnsafePointer<UInt8>) -> String in
let buffer = UnsafeBufferPointer(start: bytes, count: data.count)
return buffer.map{String(format: "%02hhx", $0)}.reduce("", {$0 + $1})
}
}