Socket
Socket
Sign inDemoInstall

@aws-crypto/crc32c

Package Overview
Dependencies
Maintainers
8
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-crypto/crc32c

Pure JS implementation of CRC32-C https://en.wikipedia.org/wiki/Cyclic_redundancy_check


Version published
Weekly downloads
6M
increased by0.36%
Maintainers
8
Weekly downloads
 
Created

What is @aws-crypto/crc32c?

The @aws-crypto/crc32c package is designed for calculating CRC32C (Cyclic Redundancy Check) checksums. This is particularly useful for verifying the integrity of data, such as files or network packets, to ensure they have not been altered during transmission or storage. The CRC32C algorithm is known for its efficiency and error-detection capabilities, making it a popular choice for error-checking applications.

What are @aws-crypto/crc32c's main functionalities?

Calculate CRC32C checksum from a string

This feature allows you to calculate the CRC32C checksum of a given string. The input string is first converted to a Buffer, and then the `crc32c` function is used to calculate the checksum. The result is a number that represents the checksum, which can be converted to a hexadecimal string for easier reading or comparison.

"use strict";
const { crc32c } = require('@aws-crypto/crc32c');

const input = Buffer.from('Hello World');
const checksum = crc32c(input);
console.log(`CRC32C Checksum: ${checksum.toString(16)}`);

Calculate CRC32C checksum from a file

This feature demonstrates how to calculate the CRC32C checksum of a file. The file is read into a Buffer using Node.js's `fs.readFileSync` method, and then the `crc32c` function is applied to this Buffer to compute the checksum. This is useful for verifying the integrity of files.

"use strict";
const fs = require('fs');
const { crc32c } = require('@aws-crypto/crc32c');

const fileBuffer = fs.readFileSync('path/to/your/file.txt');
const checksum = crc32c(fileBuffer);
console.log(`CRC32C Checksum of the file: ${checksum.toString(16)}`);

Other packages similar to @aws-crypto/crc32c

FAQs

Package last updated on 16 Oct 2023

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