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

adler32

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adler32 - npm Package Compare versions

Comparing version 0.0.5 to 0.0.7

bench.js

8

package.json
{
"name": "adler32",
"version": "0.0.5",
"version": "0.0.7",
"description": "Adler-32 hashing algorithm",

@@ -9,6 +9,8 @@ "main": "index.js",

"mhash": ">=1.0.0",
"should": ">=4.0.4"
"should": ">=4.0.4",
"random-buffer": ">=0.0.2"
},
"scripts": {
"test": "mocha -R spec ./test.js"
"test": "mocha -R spec ./test.js",
"bench": "./bench.js"
},

@@ -15,0 +17,0 @@ "repository": {

@@ -51,4 +51,17 @@ # adler32 [![Build Status](https://travis-ci.org/BlueJeansAndRain/adler32.svg?branch=master)](https://travis-ci.org/BlueJeansAndRain/adler32)

# License
## Caveats
Using a rolling window larger than 16k may cause unexpected results due to integer overflows.
## Notes
Modding of the upper and lower checksum words is delayed for up to 5,552 bytes when using the `sum()` method as a small
speed optimization.
This algorithm uses a base of 65521 (largest prime smaller than 65536) which is the base indicated by the original
Adler-32 algorithm. As such, the sums calculated by this utility *will* match those calculated by the mhash module.
Rsync uses the Adler-32 algorithm for its weak checksum, but uses a base of 65536 instead of 65521.
## License
The MIT License (MIT)

@@ -55,0 +68,0 @@

@@ -7,4 +7,6 @@ #!/usr/bin/env node

var hash = require('mhash').hash;
var rand = require('random-buffer');
var buf = fs.readFileSync(__filename);
//var buf = fs.readFileSync(__filename);
var buf = rand(32768, 'adler32');

@@ -64,2 +66,10 @@ describe('Adler32', function() {

});
it('should result in the same value as sum for each offset chunk of size 8192', function() {
rollTest(8192);
});
it('should result in the same value as sum for each offset chunk of size 16384', function() {
rollTest(16384);
});
});

@@ -66,0 +76,0 @@ });

Sorry, the diff of this file is not supported yet

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