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

cyclic-32

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cyclic-32 - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

14

lib/crc32.js

@@ -135,2 +135,4 @@ 'use strict'

var ENCODING_BUFFER = Buffer.alloc( 4, 0 )
/**

@@ -162,6 +164,10 @@ * CRC32 checksum stream

digest( encoding ) {
var buffer = Buffer.alloc( 4, 0 )
buffer.writeInt32BE( this.crc, 0 )
return encoding == null ?
buffer : buffer.toString( encoding )
if( encoding == null ) {
let buffer = Buffer.alloc( 4 )
buffer.writeInt32BE( this.crc, 0 )
return buffer
} else {
ENCODING_BUFFER.writeInt32BE( this.crc, 0 )
return ENCODING_BUFFER.toString( encoding )
}
}

@@ -168,0 +174,0 @@

{
"name": "cyclic-32",
"version": "1.1.0",
"version": "1.1.1",
"description": "Tiny, streaming, seedable CRC32 library, compatible with the crypto.Hash API",

@@ -20,9 +20,11 @@ "license": "MIT",

"main": "lib/crc32.js",
"dependencies": {},
"devDependencies": {
"mocha": "^5.2.0",
"nanobench": "^2.1.1"
"@jhermsmeier/control": "^1.3.0",
"buffer-crc32": "^0.2.13",
"crc-32": "^1.2.0",
"crc32": "^0.2.2",
"nanobench": "^2.1.1",
"polycrc": "^1.1.0",
"sse4_crc32": "^6.0.1"
},
"peerDependencies": {},
"optionalDependencies": {},
"homepage": "https://github.com/jhermsmeier/node-cyclic-32",

@@ -37,3 +39,3 @@ "repository": {

"scripts": {
"test": "mocha",
"test": "control test",
"benchmark": "node benchmark"

@@ -40,0 +42,0 @@ },

@@ -29,3 +29,23 @@ # cyclic-32

### API
```js
var checksum = crc32( buffer, seed = 0, table = crc32.TABLE.DEFAULT )
```
```js
var checksumStream = crc32.createHash({
seed: 0,
table: crc32.TABLE.DEFAULT,
})
```
**Builtin tables:**
- `crc32.TABLE.DEFAULT`: Standard CRC32
- `crc32.TABLE.CASTAGNOLI`: Castagnoli
### Examples
```js
var crc32 = require( 'cyclic-32' )

@@ -32,0 +52,0 @@ ```

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