crc-transform
v0.0.3
Published
A crc32 transform for the BOB streaming protocol.
Downloads
9
Maintainers
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.