📜  如何从 NSData swift 代码示例中接收十六进制值

📅  最后修改于: 2022-03-11 15:00:58.329000             🧑  作者: Mango

代码示例1
extension NSData {

    func hexString() -> String {
        return UnsafeBufferPointer(start: UnsafePointer(bytes), count: length)
            .reduce("") { $0 + String(format: "%02x", $1) }
    }

}