Socket
Book a DemoInstallSign in
Socket

crc-transform

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crc-transform

A crc32 transform for the BOB streaming protocol.

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

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

Keywords

BOB

FAQs

Package last updated on 08 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts