Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

crc32-stream

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crc32-stream

a streaming CRC32 checksumer

  • 7.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10M
increased by0.11%
Maintainers
1
Weekly downloads
 
Created

What is crc32-stream?

The crc32-stream npm package is designed for generating CRC32 checksums from streams of data. It is particularly useful for validating the integrity of data being transferred or stored. The package provides a way to compute CRC32 checksums efficiently on-the-fly for both streams of data and individual files.

What are crc32-stream's main functionalities?

CRC32 Checksum for Streams

This feature allows you to create a CRC32 checksum for data streams. The code sample demonstrates how to pipe a file stream through the CRC32Stream to compute its checksum.

const {CRC32Stream} = require('crc32-stream');
const fs = require('fs');

const source = fs.createReadStream('path/to/file');
const crc32Stream = new CRC32Stream();

source.pipe(crc32Stream).on('finish', function() {
  console.log('CRC32 Checksum:', crc32Stream.digest().toString(16));
});

CRC32 Checksum for Files

This feature demonstrates how to compute and append a CRC32 checksum for files. It shows the process of reading a file, computing the checksum as the file is being processed, and then writing the output to another file.

const {CRC32Stream} = require('crc32-stream');
const fs = require('fs');

const crc32Stream = new CRC32Stream();
const output = fs.createWriteStream('output.file');

fs.createReadStream('input.file')
  .pipe(crc32Stream)
  .pipe(output)
  .on('finish', function() {
    console.log('File processed with CRC32 Checksum:', crc32Stream.digest().toString(16));
  });

Other packages similar to crc32-stream

Keywords

FAQs

Package last updated on 14 Oct 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc