crc32-from-arraybuffer
Version:
20 lines (12 loc) • 663 B
Markdown
```ts
import { crc32FromArrayBuffer } from 'crc32-from-arraybuffer';
// ...
const crc: number = crc32FromArrayBuffer(arrayBuffer); // crc is int32
// ...
```
- This code is copied from stackoverflow and made small modify by @snomiao. [How to calculate the CRC of an arrayBuffer (From FileReader in javascript) compatible with the CRC32 function in php? - Stack Overflow]( https://stackoverflow.com/questions/29416900/how-to-calculate-the-crc-of-an-arraybuffer-from-filereader-in-javascript-compa )
Original authors:
- [User monstergold - Stack Overflow]( https://stackoverflow.com/users/2030324/monstergold )