1.1.0 • Published 2 years ago

yo-crc-js v1.1.0

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

yo-crc-js

A module that is used to calculate the checksum.

Installation and Usage

npm install yo-crc-js
import { crc16IBM, crc16IBMi, crc32IEEE, crc32IEEEi } from '../index';

// string '123456789'
const uint8Array = new Uint8Array([ 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39 ]);
const arrayNumber = [ 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39 ];
const str = '123456789';


console.log(`
    crc16IBM (data: Uint8Array) => ${crc16IBM(uint8Array)},
    crc16IBM (data: number[]) => ${crc16IBM(arrayNumber)},
    crc16IBM (data: string) => ${crc16IBM(str)}
    `);
1.1.0

2 years ago

1.0.1

2 years ago