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.
Tiny, streaming, seedable CRC32 library, compatible with the crypto.Hash API
A tiny, streaming, seedable CRC32 library, compatible with Node's crypto.Hash API. In less than 100 LOC.
$ npm install --save cyclic-32
var checksum = crc32( buffer, seed = 0, table = crc32.TABLE.DEFAULT )
// Shorthand for Castagnoli
var castagnoli = crc32.c( buffer, seed = 0, table = crc32.TABLE.DEFAULT )
var checksumStream = crc32.createHash({
seed: 0,
table: crc32.TABLE.DEFAULT,
})
Builtin tables:
crc32.TABLE.DEFAULT
: Standard CRC32crc32.TABLE.CASTAGNOLI
: Castagnolivar crc32 = require( 'cyclic-32' )
Calculate the CRC32 checksum of a Buffer:
var buffer = new Buffer( 'I shall be summed', 'ascii' )
console.log( crc32( buffer ) ) // -476443423
Pass a seed value:
var buffer = new Buffer( 'I shall be summoned', 'ascii' )
console.log( crc32( buffer, 666 ) ) // -823676065
Calculate the CRC32 checksum over a Stream:
fs.createReadStream( filename )
.pipe( crc32.createHash() )
.on( 'data', function( buffer ) {
console.log( 'CRC32:', buffer.toString( 'hex' ) )
})
If you want to pass an encoding
, or seed
:
fs.createReadStream( filename )
.pipe( new crc32.Hash({ encoding: 'hex', seed: -12345678 }) )
.on( 'data', function( checksum ) {
console.log( 'CRC32:', checksum )
})
Or, if you'd rather stick to the crypto.Hash
API:
var hash = crc32.createHash()
hash.update( 'I shall' )
.update( 'be summed' )
console.log( 'CRC32:', hash.digest( 'hex' ) )
Calculate the checksum of a file:
$ crc32 filename
0a0ca5aa
Pipe stuff into it via stdin:
$ cat filename | crc32
ffe6bbc0
FAQs
Tiny, streaming, seedable CRC32 library, compatible with the crypto.Hash API
The npm package cyclic-32 receives a total of 6,978 weekly downloads. As such, cyclic-32 popularity was classified as popular.
We found that cyclic-32 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.