Skip to content

Fishrock123/crc-transform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A crc32 transform for the BOB streaming protocol.

Resources

License

Stars

Watchers

Forks

Packages

No packages published