]>
git.saurik.com Git - wxWidgets.git/blob - utils/Install/packace/uac_crc.c
1 /* ------------------------------------------------------------------------ */
3 /* CRC-calculation routines. */
5 /* ------------------------------------------------------------------------ */
14 void make_crctable(void) // initializes CRC table
20 for (i
= 0; i
<= 255; i
++)
22 for (r
= i
, j
= 8; j
; j
--)
23 r
= (r
& 1) ? (r
>> 1) ^ CRCPOLY
: (r
>> 1);
28 // Updates crc from addr till addr+len-1
30 ULONG
getcrc(ULONG crc
, UCHAR
* addr
, INT len
)
33 crc
= crctable
[(unsigned char) crc
^ (*addr
++)] ^ (crc
>> 8);