         let base: UInt32 = 65521
         var s1: UInt32 = 1
         var s2: UInt32 = 0
-        for i in 0..<array.count {
-            s1 = (s1 + UInt32(array[i])) % base
+        for byte in array {
+            s1 = (s1 + UInt32(byte)) % base
             s2 = (s2 + s1) % base
         }
         return (s2 << 16) + s1


    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]))
            crc = CheckSums.crc32table[Int(index)] ^ (crc >> 8)
        }
        return ~crc


    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
