The library for calculating Cyclic Redundancy Check (CRC) for browser-side and nodejs-side
npm install @dikman/crc




The library for calculating Cyclic Redundancy Check (CRC) for browser-side. The calculation is table-based. Tables are dynamically generated once per each CRC function.
This library is an adaptation and simplification of polycrc for use it on browser-side. CRC mathematics is checked with pycrc. It seems to be no other module in npm registry wich possible to use with Angular framework.
Even though this library was designed for browser-side it also keeps the possibility to use on nodejs-side.
- Installation
- API
- Usage
- Calculate a CRC32
- Calculate a CRC24
- License
- Generated
```
npm install @dikman/crc
`js`
function crc24(str: string): Converter;
`js`
function crc32(str: string): Converter;
`js`
interface Converter {
public toHEX(prefix: string = '0x'): string;
public asNumber(): number;
}
`js
import { crc32 } from '@dikman/crc';
const checksum = crc32('hello');
console.log(checksum.toHEX());
// "0x3610A686"
console.log(checksum.asNumber());
// 907060870
`
`js
import { crc24 } from '@dikman/crc';
const checksum = crc24('hello');
console.log(checksum.toHEX());
// "0x47F58A"
console.log(checksum.asNumber());
// 4715914
``
The MIT License (MIT)
Copyright (c) 2020 Dmitriy Kuznetsov
This library was generated with Angular CLI version 8.2.14.