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

blomma

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blomma - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

11

blomma.js

@@ -16,5 +16,5 @@ var FNV = require('fnv').FNV

var Filter = function (data) {
this.buffer = new Buffer(size)
this.buffer.fill(0)
var Filter = function (databuf) {
this.buffer = new Buffer(databuf || size)
if (!databuf) this.buffer.fill(0)
}

@@ -52,4 +52,7 @@

empty: function () {
return new Filter(size)
return new Filter()
},
fromBuffer: function (buf) {
return new Filter(buf)
},
merge: function (a, b) {

@@ -56,0 +59,0 @@ var filter = new Filter()

{
"name": "blomma",
"version": "1.0.0",
"version": "1.1.0",
"description": "Bloom filters yet again",

@@ -5,0 +5,0 @@ "main": "blomma.js",

@@ -131,2 +131,14 @@ 'use strict'

})
describe('fromBuffer', function () {
it('should have made filter from buffer', function () {
var f1 = bloom.empty()
f1.add('oho')
f1.add('aha')
var f2 = bloom.fromBuffer(f1.buffer)
assert(f2.has('oho'))
assert(f2.has('aha'))
})
})
})
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