diff --git a/src/Rosetta/core/Crc16.luau b/src/Rosetta/core/Crc16.luau index 4a2caac..72fbf58 100644 --- a/src/Rosetta/core/Crc16.luau +++ b/src/Rosetta/core/Crc16.luau @@ -1,10 +1,8 @@ --!strict --!native --- core/Crc16: the two 16-bit CRCs old archive and encoding formats use, table driven. New code. --- Crc16.ccitt(buf, off, len, crc?) CRC-16/XMODEM: polynomial 0x1021, MSB first, init 0, no final XOR (BinHex 4.0, --- MacBinary II / III headers) --- Crc16.arc(buf, off, len, crc?) CRC-16/ARC: polynomial 0x8005 reflected (0xA001), init 0 (LHA, Zoo, ARC) --- Pass a previous result as crc to continue it. Never throws: the range is clamped to the buffer. +-- core/Crc16: the 16-bit CRCs old archive formats use, table driven. New code. ccitt: CRC-16/XMODEM (0x1021, MSB first, +-- init 0, no final XOR; BinHex 4.0, MacBinary II / III). arc: CRC-16/ARC (0x8005 reflected = 0xA001, init 0; LHA, Zoo, +-- ARC). Never throws: the range is clamped. local band, bxor, rshift, lshift = bit32.band, bit32.bxor, bit32.rshift, bit32.lshift local readu8 = buffer.readu8