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

bdb

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bdb - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

64

lib/key.js

@@ -213,2 +213,62 @@ /**

}
},
bhash160: {
min: Buffer.alloc(20, 0x00),
max: Buffer.alloc(20, 0xff),
dynamic: false,
size(v) {
return 20;
},
read(k, o) {
assertLen(o + 20 <= k.length);
return k.slice(o, o + 20);
},
write(k, v, o) {
assertType(Buffer.isBuffer(v));
assertType(v.copy(k, o) === 20);
return 20;
}
},
bhash256: {
min: Buffer.alloc(32, 0x00),
max: Buffer.alloc(32, 0xff),
dynamic: false,
size(v) {
return 32;
},
read(k, o) {
assertLen(o + 32 <= k.length);
return k.slice(o, o + 32);
},
write(k, v, o) {
assertType(Buffer.isBuffer(v));
assertType(v.copy(k, o) === 32);
return 32;
}
},
bhash: {
min: Buffer.alloc(1, 0x00),
max: Buffer.alloc(64, 0xff),
dynamic: true,
size(v) {
assertType(Buffer.isBuffer(v));
return 1 + v.length;
},
read(k, o) {
assertLen(o + 1 <= k.length);
assertLen(k[o] >= 1 && k[o] <= 64);
assertLen(o + 1 + k[o] <= k.length);
return k.slice(o + 1, o + 1 + k[o]);
},
write(k, v, o) {
assertType(Buffer.isBuffer(v));
assertType(v.length >= 1 && v.length <= 64);
assertLen(o + 1 <= k.length);
k[o] = v.length;
assertType(v.copy(k, o + 1) === v.length);
return 1 + v.length;
}
}

@@ -422,3 +482,3 @@ };

return data.length;
assert(typeof data === 'string');
assertType(typeof data === 'string');
return data.length >>> 1;

@@ -430,3 +490,3 @@ }

return str.copy(data, off);
assert(typeof str === 'string');
assertType(typeof str === 'string');
return data.write(str, off, 'hex');

@@ -433,0 +493,0 @@ }

2

package.json
{
"name": "bdb",
"version": "0.2.1",
"version": "0.2.2",
"description": "Database for bcoin",

@@ -5,0 +5,0 @@ "keywords": [

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