Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sail-sail/buffer_crc32

crc32 that works with binary data and fancy character sets, outputs buffer, signed or unsigned data and has tests. Derived from the sample CRC implementation in the PNG specification: http://www.w3.org/TR/PNG/#D-CRCAppendix
https://github.com/sail-sail/buffer_crc32

Last synced: 21 days ago
JSON representation

crc32 that works with binary data and fancy character sets, outputs buffer, signed or unsigned data and has tests. Derived from the sample CRC implementation in the PNG specification: http://www.w3.org/TR/PNG/#D-CRCAppendix

Awesome Lists containing this project

README

        

# buffer_crc32

crc32 that works with binary data and fancy character sets, outputs buffer, signed or unsigned data and has tests.

Derived from the sample CRC implementation in the PNG specification: http://www.w3.org/TR/PNG/#D-CRCAppendix

fock by https://github.com/brianloveswords/buffer-crc32

## usage
```ts
import { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
import { Buffer } from "https://deno.land/[email protected]/node/buffer.ts";
import crc32 from "https://deno.land/x/buffer_crc32/mod.ts";

Deno.test("crc32", function() {
const input = Buffer.from('hey sup bros');
const expected = Buffer.from([0x47, 0xfa, 0x55, 0x70]);
assertEquals(crc32(input), expected);
});
```