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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Hypercore
2
2
 
3
- ### [See the full API docs at docs.holepunch.to](https://docs.holepunch.to/building-blocks/hypercore)
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
@@ -237,7 +237,7 @@ module.exports = class Bitfield {
237
237
  return buffer
238
238
  }
239
239
 
240
- getBitfield (index, length) {
240
+ getBitfield (index) {
241
241
  const j = index & (BITS_PER_PAGE - 1)
242
242
  const i = (index - j) / BITS_PER_PAGE
243
243
 
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
- this.skipBitfield.insert(0, this.bitfield.toBuffer(this.tree.length))
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore",
3
- "version": "10.35.3",
3
+ "version": "10.36.0",
4
4
  "description": "Hypercore is a secure, distributed append-only log",
5
5
  "main": "index.js",
6
6
  "scripts": {