Merge pull request #13 from yglukhov/backward-compat

Fixed backward compatibility with older nim
This commit is contained in:
andri lim 2017-10-31 20:12:20 +07:00 committed by GitHub
commit 22b4278e75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -226,8 +226,8 @@ proc crc32(crc: uint32, buf: string): uint32 =
var crcu32 = not crc
for b in buf:
crcu32 = (crcu32 shr 4) xor kcrc32[(crcu32 and 0xF) xor (uint32(b) and 0xF'u32)]
crcu32 = (crcu32 shr 4) xor kcrc32[(crcu32 and 0xF) xor (uint32(b) shr 4'u32)]
crcu32 = (crcu32 shr 4) xor kcrc32[int((crcu32 and 0xF) xor (uint32(b) and 0xF'u32))]
crcu32 = (crcu32 shr 4) xor kcrc32[int((crcu32 and 0xF) xor (uint32(b) shr 4'u32))]
result = not crcu32