@allex/crc32
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

@allex/crc32

Provide pure JS CRC32 for nodejs & browser. Supports string, Buffer, ArrayBuffer, Uint8Array

Usage

yarn add @allex/crc32 -D
import { crc32 } from '@allex/crc32'

const testBinaryFile = path.resolve(__dirname, 'files', 'me.png')
const arrayBuffer = fs.readFileSync(testBinaryFile);

describe('use pure js crc32.js to test', () => {
  test('crc32() with string, arraybuffer', () => {
    expect(crc32('allex')).toBe(337229299);
    expect(crc32(arrayBuffer, 'hex')).toBe('79c38e61');
  });
});

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i @allex/crc32

Weekly Downloads

633

Version

1.0.4

License

MIT

Unpacked Size

6.92 kB

Total Files

6

Last publish

Collaborators

  • allex