Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@aws-crypto/crc32c
Advanced tools
Pure JS implementation of CRC32-C https://en.wikipedia.org/wiki/Cyclic_redundancy_check
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.
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)}`);
The 'fast-crc32c' package is another Node.js module for computing CRC32C checksums. It offers similar functionality to '@aws-crypto/crc32c' but focuses on performance optimizations for Node.js environments. It uses native bindings to Google's Snappy project for faster computation, making it a good alternative for performance-critical applications.
While 'buffer-crc32' computes CRC32 checksums rather than CRC32C, it serves a similar purpose in verifying data integrity. The main difference lies in the algorithm used for the checksum calculation. 'buffer-crc32' might be preferred in scenarios where CRC32 is the required standard, but '@aws-crypto/crc32c' is specifically tailored for CRC32C computations.
Pure JS implementation of CRC32-C https://en.wikipedia.org/wiki/Cyclic_redundancy_check
import { Crc32c } from '@aws-crypto/crc32c';
const crc32Digest = (new Crc32c).update(buffer).digest()
npm test
FAQs
Pure JS implementation of CRC32-C https://en.wikipedia.org/wiki/Cyclic_redundancy_check
The npm package @aws-crypto/crc32c receives a total of 5,458,475 weekly downloads. As such, @aws-crypto/crc32c popularity was classified as popular.
We found that @aws-crypto/crc32c demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.