Comparing version 0.1.0 to 0.2.0
@@ -532,3 +532,3 @@ /*! | ||
value.write(name, 0, 'ascii'); | ||
value.writeUInt32LE(version, name.length, true); | ||
value.writeUInt32LE(version, name.length); | ||
const batch = this.batch(); | ||
@@ -546,3 +546,3 @@ batch.put(key, value); | ||
const num = data.readUInt32LE(name.length, true); | ||
const num = data.readUInt32LE(name.length); | ||
@@ -549,0 +549,0 @@ if (num !== version) |
@@ -71,3 +71,3 @@ /** | ||
assertLen(o + 2 <= k.length); | ||
return k.readUInt16BE(o, true); | ||
return readU16BE(k, o); | ||
}, | ||
@@ -77,3 +77,3 @@ write(k, v, o) { | ||
assertLen(o + 2 <= k.length); | ||
k.writeUInt16BE(v, o, true); | ||
writeU16BE(k, v, o); | ||
return 2; | ||
@@ -91,3 +91,3 @@ } | ||
assertLen(o + 4 <= k.length); | ||
return k.readUInt32BE(o, true); | ||
return readU32BE(k, o); | ||
}, | ||
@@ -97,3 +97,3 @@ write(k, v, o) { | ||
assertLen(o + 4 <= k.length); | ||
k.writeUInt32BE(v, o, true); | ||
writeU32BE(k, v, o); | ||
return 4; | ||
@@ -213,3 +213,3 @@ } | ||
assertType(writeHex(k, v, o + 1, 'hex') === size); | ||
assertType(writeHex(k, v, o + 1) === size); | ||
@@ -498,2 +498,36 @@ return 1 + size; | ||
function readU32BE(data, off) { | ||
const first = data[off]; | ||
const last = data[off + 3]; | ||
return first * 2 ** 24 + | ||
data[++off] * 2 ** 16 + | ||
data[++off] * 2 ** 8 + | ||
last; | ||
} | ||
function readU16BE(data, off) { | ||
const first = data[off]; | ||
const last = data[off + 1]; | ||
return first * 2 ** 8 + last; | ||
} | ||
function writeU32BE(dst, num, off) { | ||
dst[off + 3] = num; | ||
num = num >>> 8; | ||
dst[off + 2] = num; | ||
num = num >>> 8; | ||
dst[off + 1] = num; | ||
num = num >>> 8; | ||
dst[off] = num; | ||
return off + 4; | ||
} | ||
function writeU16BE(dst, num, off) { | ||
dst[off++] = (num >>> 8); | ||
dst[off++] = num; | ||
return off; | ||
} | ||
/* | ||
@@ -500,0 +534,0 @@ * Expose |
{ | ||
"name": "bdb", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Database for bcoin", | ||
@@ -25,21 +25,22 @@ "keywords": [ | ||
"test": "mocha --reporter spec test/*-test.js", | ||
"webpack": "webpack --config webpack.config.js" | ||
"webpack": "webpack --mode production --config webpack.config.js" | ||
}, | ||
"dependencies": { | ||
"leveldown": "3.0.0" | ||
"leveldown": "4.0.1" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "^6.26.0", | ||
"babel-core": "^6.26.3", | ||
"babel-loader": "^7.1.4", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-env": "^1.7.0", | ||
"babelify": "^8.0.0", | ||
"browserify": "^16.1.1", | ||
"eslint": "^4.18.2", | ||
"mocha": "^5.0.4", | ||
"browserify": "^16.2.2", | ||
"eslint": "^4.19.1", | ||
"mocha": "^5.2.0", | ||
"uglify-es": "^3.3.9", | ||
"uglifyjs-webpack-plugin": "^1.2.3", | ||
"webpack": "^4.1.1" | ||
"uglifyjs-webpack-plugin": "^1.2.5", | ||
"webpack": "^4.11.1", | ||
"webpack-cli": "^3.0.3" | ||
}, | ||
"engines": { | ||
"node": ">=7.6.0" | ||
"node": ">=8.0.0" | ||
}, | ||
@@ -46,0 +47,0 @@ "browser": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
90924
3693
11
+ Addedabstract-leveldown@5.0.0(transitive)
+ Addedleveldown@4.0.1(transitive)
+ Addednan@2.10.0(transitive)
+ Addedprebuild-install@4.0.0(transitive)
- Removedabstract-leveldown@4.0.3(transitive)
- Removedleveldown@3.0.0(transitive)
- Removednan@2.8.0(transitive)
- Removedprebuild-install@2.5.3(transitive)
Updatedleveldown@4.0.1