X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=crc32.c;fp=crc32.c;h=62cb9fe34ffc6e0f850e0481e6a66b120ac8e0e8;hb=d71dc66fa8a153fb6e7c626847095d9697a6cf42;hp=7503972b5b0c27f5a1a91d4853c376aaf5ca8a5b;hpb=02064366155215162223417b939deebfe563ded0;p=zlib.git diff --git a/crc32.c b/crc32.c index 7503972..62cb9fe 100644 --- a/crc32.c +++ b/crc32.c @@ -224,7 +224,7 @@ local once_t made = ONCE_INIT; is just exclusive-or, and multiplying a polynomial by x is a right shift by one. If we call the above polynomial p, and represent a byte as the polynomial q, also with the lowest power in the most significant bit (so the - byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, + byte 0xb1 is the polynomial x^7+x^3+x^2+1), then the CRC is (q*x^32) mod p, where a mod b means the remainder after dividing a by b. This calculation is done using the shift-register method of multiplying and