crc-transform

0.0.3 • Public • Published

CRC Transform (BOB)

A Cyclic Redundancy Check Transform for the BOB streaming protocol.

Usage

const CRC = require('crc-transform')
new CRC(Buffer.alloc(size))

Implements a BOB transform which uses the crc library to compute a 32-bit crc.

Example

const CRC = require('crc-transform')
 
const {
  Stream,
  StdoutSink 
= require('bob-streams')
const FileSource = require('fs-source')
 
const source = new FileSource(process.argv[2])
const sink = new StdoutSink('hex')
 
const stream = new Stream(
  source,
  new CRC(Buffer.alloc(64 * 1024)),
  sink
)
stream.start(error => {
  if (error) {
    console.error('Stream error ->', error)
  }
})

See test-basic for a good working example.

License

MIT LicensedContributions via DCO 1.1

Package Sidebar

Install

npm i crc-transform

Weekly Downloads

2

Version

0.0.3

License

MIT

Unpacked Size

6.04 kB

Total Files

10

Last publish

Collaborators

  • fishrock123