@allex/crc32
v1.0.4
Published
Provide pure JS CRC32 for nodejs & browser. Supports string, Buffer, ArrayBuffer, Uint8Array
Downloads
784
Readme
@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');
});
});