crc-transform

A crc32 transform for the BOB streaming protocol.

Usage no npm install needed!

<script type="module">
  import crcTransform from 'https://cdn.skypack.dev/crc-transform';
</script>

README

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