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 1.0.0 to 1.1.0

72

lib/key.js

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

}
},
hhash160: {
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.toString('hex', o, o + 20);
},
write(k, v, o) {
assertType(writeHex(k, v, o) === 20);
return 20;
}
},
hhash256: {
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.toString('hex', o, o + 32);
},
write(k, v, o) {
assertType(writeHex(k, v, o) === 32);
return 32;
}
},
hhash: {
min: Buffer.alloc(1, 0x00),
max: Buffer.alloc(64, 0xff),
dynamic: true,
size(v) {
return 1 + sizeHex(v);
},
read(k, o) {
assertLen(o + 1 <= k.length);
assertLen(k[o] >= 1 && k[o] <= 64);
assertLen(o + 1 + k[o] <= k.length);
return k.toString('hex', o + 1, o + 1 + k[o]);
},
write(k, v, o) {
const size = sizeHex(v);
assertType(size >= 1 && size <= 64);
assertLen(o + 1 <= k.length);
k[o] = size;
assertType(writeHex(k, v, o + 1) === size);
return 1 + size;
}
}

@@ -463,2 +521,16 @@ };

function sizeHex(data) {
if (Buffer.isBuffer(data))
return data.length;
assertType(typeof data === 'string');
return data.length >>> 1;
}
function writeHex(data, str, off) {
if (Buffer.isBuffer(str))
return str.copy(data, off);
assertType(typeof str === 'string');
return data.write(str, off, 'hex');
}
function assertLen(ok) {

@@ -465,0 +537,0 @@ if (!ok) {

2

package.json
{
"name": "bdb",
"version": "1.0.0",
"version": "1.1.0",
"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