// // crc8.swift // Twear // // Created by yangbin on 2021/12/8. // import UIKit func crc8(bytes: [UInt8]) -> UInt8 { if bytes.count == 0 { return 0x00 } let len = bytes.count // let bytes = [UInt8](data) var temp: UInt8 = 0xFF // let len = data!.count for i in 0..> 1^0xB8 } else { temp >>= 1 } } } return temp }