@taichunmin/crc
Version:
A cross platform alternative for calculating Cyclic Redundancy Checks (CRC) values.
60 lines (58 loc) • 2.45 kB
text/typescript
declare class GenericCrc16 {
name: string;
readonly initial: number;
readonly poly: number;
readonly refin: boolean;
readonly refout: boolean;
readonly tbl: Uint16Array<ArrayBuffer>;
readonly u16: Uint16Array<ArrayBuffer>;
readonly xorout: number;
constructor(opts: {
name: string;
poly: number;
initial: number;
xorout: number;
refin: boolean;
refout: boolean;
});
buildPoly(poly: number): void;
getCrc(buf: Uint8Array): number;
dumpPoly(space?: number): string;
exportCrcFn(): string;
exportTest1(): string;
exportTest2(): string;
}
declare const crc16a: GenericCrc16;
declare const crc16arc: GenericCrc16;
declare const crc16augccitt: GenericCrc16;
declare const crc16buypass: GenericCrc16;
declare const crc16ccittfalse: GenericCrc16;
declare const crc16cdma2000: GenericCrc16;
declare const crc16cms: GenericCrc16;
declare const crc16dds110: GenericCrc16;
declare const crc16dectr: GenericCrc16;
declare const crc16dectx: GenericCrc16;
declare const crc16dnp: GenericCrc16;
declare const crc16en13757: GenericCrc16;
declare const crc16genibus: GenericCrc16;
declare const crc16gsm: GenericCrc16;
declare const crc16iclass: GenericCrc16;
declare const crc16kermit: GenericCrc16;
declare const crc16lj1200: GenericCrc16;
declare const crc16m17: GenericCrc16;
declare const crc16maxim: GenericCrc16;
declare const crc16mcrf4xx: GenericCrc16;
declare const crc16modbus: GenericCrc16;
declare const crc16nrsc5: GenericCrc16;
declare const crc16opensafetya: GenericCrc16;
declare const crc16opensafetyb: GenericCrc16;
declare const crc16philips: GenericCrc16;
declare const crc16profibus: GenericCrc16;
declare const crc16riello: GenericCrc16;
declare const crc16t10dif: GenericCrc16;
declare const crc16teledisk: GenericCrc16;
declare const crc16tms37157: GenericCrc16;
declare const crc16usb: GenericCrc16;
declare const crc16x25: GenericCrc16;
declare const crc16xmodem: GenericCrc16;
export { GenericCrc16, crc16a, crc16arc, crc16augccitt, crc16buypass, crc16ccittfalse, crc16cdma2000, crc16cms, crc16dds110, crc16dectr, crc16dectx, crc16dnp, crc16en13757, crc16genibus, crc16gsm, crc16iclass, crc16kermit, crc16lj1200, crc16m17, crc16maxim, crc16mcrf4xx, crc16modbus, crc16nrsc5, crc16opensafetya, crc16opensafetyb, crc16philips, crc16profibus, crc16riello, crc16t10dif, crc16teledisk, crc16tms37157, crc16usb, crc16x25, crc16xmodem };