Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/sail-sail/buffer_crc32
- Owner: sail-sail
- License: mit
- Created: 2022-05-23T02:37:27.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-05-23T03:21:18.000Z (over 2 years ago)
- Last Synced: 2024-10-04T13:11:52.031Z (about 1 month ago)
- Language: TypeScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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);
});
```