 
     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


    static func crc64(_ array: [UInt8]) -> UInt64 {
        var crc: UInt64 = ~0
        for i in 0..<array.count {
            let index = (crc & 0xFF) ^ (UInt64(array[i]))
            crc = CheckSums.crc64table[Int(bitPattern: UInt(truncatingIfNeeded: index))] ^ (crc >> 8)
        }
        return ~crc

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