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

@ronomon/deduplication

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ronomon/deduplication - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

10

binding.js

@@ -176,2 +176,5 @@ 'use strict';

while (sourceOffset < sourceLength) {
// If more `source` buffers will follow and if current `source` buffer does
// not have more than `minimum` remaining, then avoid artificial cutpoint:
if (flags === 0 && (sourceLength - sourceOffset) <= minimum) break;
var chunkSize = cut(

@@ -190,6 +193,11 @@ average,

}
if (chunkSize < minimum && flags === 0) {
throw new Error('chunkSize < minimum && flags === 0');
}
if (chunkSize > maximum) {
throw new Error('chunkSize > maximum');
}
if (sourceOffset + chunkSize > sourceLength) {
throw new Error('sourceOffset + chunkSize > sourceLength');
}
if (flags === 0 && (sourceOffset + chunkSize) === sourceLength) break;
if (targetOffset + 32 + 4 > targetLength) {

@@ -196,0 +204,0 @@ throw new Error('target overflow');

2

package.json
{
"name": "@ronomon/deduplication",
"version": "1.0.0",
"version": "1.1.0",
"description": "Fast multi-threaded content-dependent chunking deduplication for Buffers in C++ with a reference implementation in Javascript. Ships with extensive tests, a fuzz test and a benchmark.",

@@ -5,0 +5,0 @@ "main": "binding.node",

@@ -82,9 +82,9 @@ var crypto = require('crypto');

}
var buffers = [];
while (size > 0) {
var buffer = Test.randomBytes(Math.min(1024 * 1024, size));
buffers.push(buffer);
size -= buffer.length;
if (Test.random() < 0.2) {
// Long repeating runs of the same byte tend to hit the maximum threshold.
// This is good for deduplication ratio (and good for bug-spotting).
return Buffer.alloc(size, Math.floor(Test.random() * 256));
} else {
return Test.randomBytes(size);
}
return Buffer.concat(buffers);
}

@@ -91,0 +91,0 @@

Sorry, the diff of this file is not supported yet

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