hypercore 10.35.3 → 10.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.js +2 -1
- package/lib/bitfield.js +1 -1
- package/lib/core.js +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Hypercore
|
|
2
2
|
|
|
3
|
-
### [See the full API docs at docs.
|
|
3
|
+
### [See the full API docs at docs.pears.com](https://docs.pears.com/building-blocks/hypercore)
|
|
4
4
|
|
|
5
5
|
Hypercore is a secure, distributed append-only log.
|
|
6
6
|
|
package/index.js
CHANGED
|
@@ -142,7 +142,8 @@ module.exports = class Hypercore extends EventEmitter {
|
|
|
142
142
|
|
|
143
143
|
static MAX_SUGGESTED_BLOCK_SIZE = MAX_SUGGESTED_BLOCK_SIZE
|
|
144
144
|
|
|
145
|
-
static key (manifest, { compat } = {}) {
|
|
145
|
+
static key (manifest, { compat, version, namespace } = {}) {
|
|
146
|
+
if (b4a.isBuffer(manifest)) manifest = { version, signers: [{ publicKey: manifest, namespace }] }
|
|
146
147
|
return compat ? manifest.signers[0].publicKey : manifestHash(createManifest(manifest))
|
|
147
148
|
}
|
|
148
149
|
|
package/lib/bitfield.js
CHANGED
package/lib/core.js
CHANGED
|
@@ -925,7 +925,9 @@ module.exports = class Core {
|
|
|
925
925
|
openSkipBitfield () {
|
|
926
926
|
if (this.skipBitfield !== null) return this.skipBitfield
|
|
927
927
|
this.skipBitfield = new RemoteBitfield()
|
|
928
|
-
|
|
928
|
+
const buf = this.bitfield.toBuffer(this.tree.length)
|
|
929
|
+
const bitfield = new Uint32Array(buf.buffer, buf.byteOffset, buf.byteLength / 4)
|
|
930
|
+
this.skipBitfield.insert(0, bitfield)
|
|
929
931
|
return this.skipBitfield
|
|
930
932
|
}
|
|
931
933
|
|