 
     static func crc32(_ array: [UInt8], prevValue: UInt32 = 0) -> UInt32 {
         var crc = ~prevValue
-        for i in 0..<array.count {
-            let index = (crc & 0xFF) ^ (UInt32(array[i]))
+        for byte in array {
+            let index = (crc & 0xFF) ^ (UInt32(byte))
             crc = CheckSums.crc32table[Int(index)] ^ (crc >> 8)
         }
         return ~crc

        let base = 65521
        var s1 = 1
        var s2 = 0
        for i in 0..<data.count {
            s1 = (s1 + data[i].toInt()) % base
            s2 = (s2 + s1) % base
        }
        return (s2 << 16) + s1


    static func crc32(_ data: Data, prevValue: UInt32 = 0) -> UInt32 {
        var crc = ~prevValue
        for byte in data {
            let index = (crc & 0xFF) ^ (UInt32(byte))
            crc = CheckSums.crc32table[Int(index)] ^ (crc >> 8)
        }
        return ~crc
