@fireproof/core 0.5.16 → 0.5.17

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.
@@ -32,17 +32,9 @@ function getAugmentedNamespace(n) {
32
32
  return a;
33
33
  }
34
34
 
35
- var browserExports$1 = {};
36
- var browser$d = {
37
- get exports(){ return browserExports$1; },
38
- set exports(v){ browserExports$1 = v; },
39
- };
35
+ var browser$d = {exports: {}};
40
36
 
41
- var safeBufferExports = {};
42
- var safeBuffer$1 = {
43
- get exports(){ return safeBufferExports; },
44
- set exports(v){ safeBufferExports = v; },
45
- };
37
+ var safeBuffer$1 = {exports: {}};
46
38
 
47
39
  var global$1 = (typeof global !== "undefined" ? global :
48
40
  typeof self !== "undefined" ? self :
@@ -2107,8 +2099,10 @@ var require$$6$1 = /*@__PURE__*/getAugmentedNamespace(_polyfillNode_buffer);
2107
2099
  throw new TypeError('Argument must be a number')
2108
2100
  }
2109
2101
  return buffer.SlowBuffer(size)
2110
- };
2111
- } (safeBuffer$1, safeBufferExports));
2102
+ };
2103
+ } (safeBuffer$1, safeBuffer$1.exports));
2104
+
2105
+ var safeBufferExports = safeBuffer$1.exports;
2112
2106
 
2113
2107
  // limit of Crypto.getRandomValues()
2114
2108
  // https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues
@@ -2159,6 +2153,9 @@ function randomBytes$2 (size, cb) {
2159
2153
  return bytes
2160
2154
  }
2161
2155
 
2156
+ var browserExports$1 = browser$d.exports;
2157
+ var randomBytes$3 = /*@__PURE__*/getDefaultExportFromCjs(browserExports$1);
2158
+
2162
2159
  var encode_1$2 = encode$9;
2163
2160
 
2164
2161
  var MSB$4 = 0x80
@@ -2241,13 +2238,13 @@ var length$2 = function (value) {
2241
2238
  )
2242
2239
  };
2243
2240
 
2244
- var varint$2 = {
2241
+ var varint$3 = {
2245
2242
  encode: encode_1$2
2246
2243
  , decode: decode$d
2247
2244
  , encodingLength: length$2
2248
2245
  };
2249
2246
 
2250
- var _brrp_varint$1 = varint$2;
2247
+ var _brrp_varint$1 = varint$3;
2251
2248
 
2252
2249
  /**
2253
2250
  * @param {Uint8Array} data
@@ -5713,12 +5710,12 @@ async function findEventsToSync (blocks, head) {
5713
5710
  // console.time(callTag + '.findCommonAncestorWithSortedEvents')
5714
5711
  const { ancestor, sorted } = await findCommonAncestorWithSortedEvents(events, head);
5715
5712
  // console.timeEnd(callTag + '.findCommonAncestorWithSortedEvents')
5716
- // console.log('sorted', !!ancestor, sorted.length)
5713
+ // console.log('sorted', !!ancestor, sorted)
5717
5714
  // console.time(callTag + '.contains')
5718
5715
 
5719
5716
  const toSync = ancestor ? await asyncFilter(sorted, async uks => !(await contains(events, ancestor, uks.cid))) : sorted;
5720
5717
  // console.timeEnd(callTag + '.contains')
5721
- // console.log('optimize sorted', !!ancestor, sorted.length - toSync.length)
5718
+ console.log('optimize sorted', !!ancestor, sorted.length - toSync.length);
5722
5719
 
5723
5720
  return { cids: events, events: toSync }
5724
5721
  }
@@ -7162,6 +7159,8 @@ var varint$1 = {
7162
7159
  , encodingLength: length$1
7163
7160
  };
7164
7161
 
7162
+ var varint$2 = /*@__PURE__*/getDefaultExportFromCjs(varint$1);
7163
+
7165
7164
  const CIDV0_BYTES = {
7166
7165
  SHA2_256: 0x12,
7167
7166
  LENGTH: 0x20,
@@ -7186,8 +7185,8 @@ function decodeVarint (bytes, seeker) {
7186
7185
  if (!bytes.length) {
7187
7186
  throw new Error('Unexpected end of data')
7188
7187
  }
7189
- const i = varint$1.decode(bytes);
7190
- seeker.seek(/** @type {number} */(varint$1.decode.bytes));
7188
+ const i = varint$2.decode(bytes);
7189
+ seeker.seek(/** @type {number} */(varint$2.decode.bytes));
7191
7190
  return i
7192
7191
  /* c8 ignore next 2 */
7193
7192
  // Node.js 12 c8 bug
@@ -7238,10 +7237,10 @@ function getMultihashLength (bytes) {
7238
7237
  // where both code and length are varints, so we have to decode
7239
7238
  // them first before we can know total length
7240
7239
 
7241
- varint$1.decode(bytes); // code
7242
- const codeLength = /** @type {number} */(varint$1.decode.bytes);
7243
- const length = varint$1.decode(bytes.subarray(varint$1.decode.bytes));
7244
- const lengthLength = /** @type {number} */(varint$1.decode.bytes);
7240
+ varint$2.decode(bytes); // code
7241
+ const codeLength = /** @type {number} */(varint$2.decode.bytes);
7242
+ const length = varint$2.decode(bytes.subarray(varint$2.decode.bytes));
7243
+ const lengthLength = /** @type {number} */(varint$2.decode.bytes);
7245
7244
  const mhLength = codeLength + lengthLength + length;
7246
7245
 
7247
7246
  return mhLength
@@ -7949,7 +7948,7 @@ const addRoot = (writer, root, options = {}) => {
7949
7948
  */
7950
7949
  const blockLength = ({ cid, bytes }) => {
7951
7950
  const size = cid.bytes.byteLength + bytes.byteLength;
7952
- return varint$1.encodingLength(size) + size
7951
+ return varint$2.encodingLength(size) + size
7953
7952
  };
7954
7953
 
7955
7954
  /**
@@ -7958,7 +7957,7 @@ const blockLength = ({ cid, bytes }) => {
7958
7957
  */
7959
7958
  const addBlock = (writer, { cid, bytes }) => {
7960
7959
  const byteLength = cid.bytes.byteLength + bytes.byteLength;
7961
- const size = varint$1.encode(byteLength);
7960
+ const size = varint$2.encode(byteLength);
7962
7961
  if (writer.byteOffset + size.length + byteLength > writer.bytes.byteLength) {
7963
7962
  throw new RangeError('Buffer has no capacity for this block')
7964
7963
  } else {
@@ -7978,7 +7977,7 @@ const close = (writer, options = {}) => {
7978
7977
  const { roots, bytes, byteOffset, headerSize } = writer;
7979
7978
 
7980
7979
  const headerBytes = encode$5({ version: 1, roots });
7981
- const varintBytes = varint$1.encode(headerBytes.length);
7980
+ const varintBytes = varint$2.encode(headerBytes.length);
7982
7981
 
7983
7982
  const size = varintBytes.length + headerBytes.byteLength;
7984
7983
  const offset = headerSize - size;
@@ -8055,7 +8054,7 @@ const calculateHeaderLength = (rootLengths) => {
8055
8054
  tokens.push(new Token(Type.bytes, { length: rootLength + 1 }));
8056
8055
  }
8057
8056
  const length = tokensToLength(tokens); // no options needed here because we have simple tokens
8058
- return varint$1.encodingLength(length) + length
8057
+ return varint$2.encodingLength(length) + length
8059
8058
  };
8060
8059
 
8061
8060
  /**
@@ -8398,23 +8397,11 @@ replaceTraps((oldTraps) => ({
8398
8397
  has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),
8399
8398
  }));
8400
8399
 
8401
- var cargoQueueExports = {};
8402
- var cargoQueue$1 = {
8403
- get exports(){ return cargoQueueExports; },
8404
- set exports(v){ cargoQueueExports = v; },
8405
- };
8400
+ var cargoQueue$1 = {exports: {}};
8406
8401
 
8407
- var queueExports = {};
8408
- var queue$1 = {
8409
- get exports(){ return queueExports; },
8410
- set exports(v){ queueExports = v; },
8411
- };
8402
+ var queue$1 = {exports: {}};
8412
8403
 
8413
- var onlyOnceExports = {};
8414
- var onlyOnce = {
8415
- get exports(){ return onlyOnceExports; },
8416
- set exports(v){ onlyOnceExports = v; },
8417
- };
8404
+ var onlyOnce = {exports: {}};
8418
8405
 
8419
8406
  (function (module, exports) {
8420
8407
 
@@ -8430,8 +8417,10 @@ var onlyOnce = {
8430
8417
  callFn.apply(this, args);
8431
8418
  };
8432
8419
  }
8433
- module.exports = exports["default"];
8434
- } (onlyOnce, onlyOnceExports));
8420
+ module.exports = exports["default"];
8421
+ } (onlyOnce, onlyOnce.exports));
8422
+
8423
+ var onlyOnceExports = onlyOnce.exports;
8435
8424
 
8436
8425
  var setImmediate$1 = {};
8437
8426
 
@@ -8468,11 +8457,7 @@ if (hasQueueMicrotask) {
8468
8457
 
8469
8458
  setImmediate$1.default = wrap(_defer);
8470
8459
 
8471
- var DoublyLinkedListExports = {};
8472
- var DoublyLinkedList = {
8473
- get exports(){ return DoublyLinkedListExports; },
8474
- set exports(v){ DoublyLinkedListExports = v; },
8475
- };
8460
+ var DoublyLinkedList = {exports: {}};
8476
8461
 
8477
8462
  (function (module, exports) {
8478
8463
 
@@ -8565,22 +8550,16 @@ var DoublyLinkedList = {
8565
8550
  dll.length = 1;
8566
8551
  dll.head = dll.tail = node;
8567
8552
  }
8568
- module.exports = exports["default"];
8569
- } (DoublyLinkedList, DoublyLinkedListExports));
8553
+ module.exports = exports["default"];
8554
+ } (DoublyLinkedList, DoublyLinkedList.exports));
8555
+
8556
+ var DoublyLinkedListExports = DoublyLinkedList.exports;
8570
8557
 
8571
8558
  var wrapAsync = {};
8572
8559
 
8573
- var asyncifyExports = {};
8574
- var asyncify = {
8575
- get exports(){ return asyncifyExports; },
8576
- set exports(v){ asyncifyExports = v; },
8577
- };
8560
+ var asyncify = {exports: {}};
8578
8561
 
8579
- var initialParamsExports = {};
8580
- var initialParams = {
8581
- get exports(){ return initialParamsExports; },
8582
- set exports(v){ initialParamsExports = v; },
8583
- };
8562
+ var initialParams = {exports: {}};
8584
8563
 
8585
8564
  (function (module, exports) {
8586
8565
 
@@ -8595,13 +8574,15 @@ var initialParams = {
8595
8574
  };
8596
8575
  };
8597
8576
 
8598
- module.exports = exports["default"];
8599
- } (initialParams, initialParamsExports));
8577
+ module.exports = exports["default"];
8578
+ } (initialParams, initialParams.exports));
8579
+
8580
+ var initialParamsExports = initialParams.exports;
8600
8581
 
8601
8582
  var hasRequiredAsyncify;
8602
8583
 
8603
8584
  function requireAsyncify () {
8604
- if (hasRequiredAsyncify) return asyncifyExports;
8585
+ if (hasRequiredAsyncify) return asyncify.exports;
8605
8586
  hasRequiredAsyncify = 1;
8606
8587
  (function (module, exports) {
8607
8588
 
@@ -8720,9 +8701,9 @@ function requireAsyncify () {
8720
8701
  }, err);
8721
8702
  }
8722
8703
  }
8723
- module.exports = exports['default'];
8724
- } (asyncify, asyncifyExports));
8725
- return asyncifyExports;
8704
+ module.exports = exports['default'];
8705
+ } (asyncify, asyncify.exports));
8706
+ return asyncify.exports;
8726
8707
  }
8727
8708
 
8728
8709
  var hasRequiredWrapAsync;
@@ -9059,8 +9040,10 @@ function requireWrapAsync () {
9059
9040
  });
9060
9041
  return q;
9061
9042
  }
9062
- module.exports = exports['default'];
9063
- } (queue$1, queueExports));
9043
+ module.exports = exports['default'];
9044
+ } (queue$1, queue$1.exports));
9045
+
9046
+ var queueExports = queue$1.exports;
9064
9047
 
9065
9048
  (function (module, exports) {
9066
9049
 
@@ -9132,9 +9115,10 @@ function requireWrapAsync () {
9132
9115
  function cargo(worker, concurrency, payload) {
9133
9116
  return (0, _queue2.default)(worker, concurrency, payload);
9134
9117
  }
9135
- module.exports = exports['default'];
9136
- } (cargoQueue$1, cargoQueueExports));
9118
+ module.exports = exports['default'];
9119
+ } (cargoQueue$1, cargoQueue$1.exports));
9137
9120
 
9121
+ var cargoQueueExports = cargoQueue$1.exports;
9138
9122
  var cargoQueue = /*@__PURE__*/getDefaultExportFromCjs(cargoQueueExports);
9139
9123
 
9140
9124
  var cryptoBrowserify = {};
@@ -9171,11 +9155,7 @@ var _polyfillNode_inherits = /*#__PURE__*/Object.freeze({
9171
9155
 
9172
9156
  var require$$3$1 = /*@__PURE__*/getAugmentedNamespace(_polyfillNode_inherits);
9173
9157
 
9174
- var readableBrowserExports = {};
9175
- var readableBrowser = {
9176
- get exports(){ return readableBrowserExports; },
9177
- set exports(v){ readableBrowserExports = v; },
9178
- };
9158
+ var readableBrowser = {exports: {}};
9179
9159
 
9180
9160
  var domain;
9181
9161
 
@@ -13572,8 +13552,10 @@ var pipeline_1 = pipeline;
13572
13552
  exports.Transform = _stream_transform;
13573
13553
  exports.PassThrough = _stream_passthrough;
13574
13554
  exports.finished = endOfStream;
13575
- exports.pipeline = pipeline_1;
13576
- } (readableBrowser, readableBrowserExports));
13555
+ exports.pipeline = pipeline_1;
13556
+ } (readableBrowser, readableBrowser.exports));
13557
+
13558
+ var readableBrowserExports = readableBrowser.exports;
13577
13559
 
13578
13560
  var Buffer$E = safeBufferExports.Buffer;
13579
13561
  var Transform$6 = readableBrowserExports.Transform;
@@ -13979,11 +13961,7 @@ function fn5 (a, b, c, d, e, m, k, s) {
13979
13961
 
13980
13962
  var ripemd160 = RIPEMD160$4;
13981
13963
 
13982
- var sha_jsExports = {};
13983
- var sha_js = {
13984
- get exports(){ return sha_jsExports; },
13985
- set exports(v){ sha_jsExports = v; },
13986
- };
13964
+ var sha_js = {exports: {}};
13987
13965
 
13988
13966
  var Buffer$B = safeBufferExports.Buffer;
13989
13967
 
@@ -14787,6 +14765,8 @@ exports.sha256 = sha256$1;
14787
14765
  exports.sha384 = sha384$1;
14788
14766
  exports.sha512 = sha512$1;
14789
14767
 
14768
+ var sha_jsExports = sha_js.exports;
14769
+
14790
14770
  function BufferList() {
14791
14771
  this.head = null;
14792
14772
  this.tail = null;
@@ -16737,12 +16717,6 @@ var browser$9 = function createHmac (alg, key) {
16737
16717
  return new Hmac$2(alg, key)
16738
16718
  };
16739
16719
 
16740
- var algosExports = {};
16741
- var algos = {
16742
- get exports(){ return algosExports; },
16743
- set exports(v){ algosExports = v; },
16744
- };
16745
-
16746
16720
  var sha224WithRSAEncryption = {
16747
16721
  sign: "rsa",
16748
16722
  hash: "sha224",
@@ -16907,9 +16881,7 @@ var require$$6 = {
16907
16881
  }
16908
16882
  };
16909
16883
 
16910
- (function (module) {
16911
- module.exports = require$$6;
16912
- } (algos));
16884
+ var algos = require$$6;
16913
16885
 
16914
16886
  var browser$8 = {};
16915
16887
 
@@ -19149,7 +19121,7 @@ var modes = {};
19149
19121
  exports['des-ede'] = {
19150
19122
  key: 16,
19151
19123
  iv: 0
19152
- };
19124
+ };
19153
19125
  } (modes));
19154
19126
 
19155
19127
  var DES = browserifyDes;
@@ -19222,11 +19194,9 @@ browser$7.listCiphers = browser$7.getCiphers = getCiphers;
19222
19194
 
19223
19195
  var browser$5 = {};
19224
19196
 
19225
- var bnExports$1 = {};
19226
- var bn$1 = {
19227
- get exports(){ return bnExports$1; },
19228
- set exports(v){ bnExports$1 = v; },
19229
- };
19197
+ var bn$1 = {exports: {}};
19198
+
19199
+ bn$1.exports;
19230
19200
 
19231
19201
  (function (module) {
19232
19202
  (function (module, exports) {
@@ -22671,19 +22641,17 @@ var bn$1 = {
22671
22641
  var res = this.imod(a._invmp(this.m).mul(this.r2));
22672
22642
  return res._forceRed(this);
22673
22643
  };
22674
- })(module, commonjsGlobal);
22644
+ })(module, commonjsGlobal);
22675
22645
  } (bn$1));
22676
22646
 
22677
- var brorandExports = {};
22678
- var brorand = {
22679
- get exports(){ return brorandExports; },
22680
- set exports(v){ brorandExports = v; },
22681
- };
22647
+ var bnExports$1 = bn$1.exports;
22648
+
22649
+ var brorand = {exports: {}};
22682
22650
 
22683
22651
  var hasRequiredBrorand;
22684
22652
 
22685
22653
  function requireBrorand () {
22686
- if (hasRequiredBrorand) return brorandExports;
22654
+ if (hasRequiredBrorand) return brorand.exports;
22687
22655
  hasRequiredBrorand = 1;
22688
22656
  var r;
22689
22657
 
@@ -22697,7 +22665,7 @@ function requireBrorand () {
22697
22665
  function Rand(rand) {
22698
22666
  this.rand = rand;
22699
22667
  }
22700
- brorandExports.Rand = Rand;
22668
+ brorand.exports.Rand = Rand;
22701
22669
 
22702
22670
  Rand.prototype.generate = function generate(len) {
22703
22671
  return this._rand(len);
@@ -22750,7 +22718,7 @@ function requireBrorand () {
22750
22718
  } catch (e) {
22751
22719
  }
22752
22720
  }
22753
- return brorandExports;
22721
+ return brorand.exports;
22754
22722
  }
22755
22723
 
22756
22724
  var mr;
@@ -23257,17 +23225,11 @@ function requireBrowser$2 () {
23257
23225
  return browser$5;
23258
23226
  }
23259
23227
 
23260
- var signExports = {};
23261
- var sign = {
23262
- get exports(){ return signExports; },
23263
- set exports(v){ signExports = v; },
23264
- };
23228
+ var sign = {exports: {}};
23265
23229
 
23266
- var bnExports = {};
23267
- var bn = {
23268
- get exports(){ return bnExports; },
23269
- set exports(v){ bnExports = v; },
23270
- };
23230
+ var bn = {exports: {}};
23231
+
23232
+ bn.exports;
23271
23233
 
23272
23234
  (function (module) {
23273
23235
  (function (module, exports) {
@@ -26617,9 +26579,11 @@ var bn = {
26617
26579
  var res = this.imod(a._invmp(this.m).mul(this.r2));
26618
26580
  return res._forceRed(this);
26619
26581
  };
26620
- })(module, commonjsGlobal);
26582
+ })(module, commonjsGlobal);
26621
26583
  } (bn));
26622
26584
 
26585
+ var bnExports = bn.exports;
26586
+
26623
26587
  var BN$a = bnExports;
26624
26588
  var randomBytes$1 = browserExports$1;
26625
26589
 
@@ -26790,7 +26754,7 @@ var utils$k = {};
26790
26754
  return toHex(arr);
26791
26755
  else
26792
26756
  return arr;
26793
- };
26757
+ };
26794
26758
  } (utils$k));
26795
26759
 
26796
26760
  (function (exports) {
@@ -26910,7 +26874,7 @@ var utils$k = {};
26910
26874
  function intFromLE(bytes) {
26911
26875
  return new BN(bytes, 'hex', 'le');
26912
26876
  }
26913
- utils.intFromLE = intFromLE;
26877
+ utils.intFromLE = intFromLE;
26914
26878
  } (utils$l));
26915
26879
 
26916
26880
  var curve = {};
@@ -28849,7 +28813,7 @@ Point.prototype.mixedAdd = Point.prototype.add;
28849
28813
  curve.base = base$2;
28850
28814
  curve.short = short;
28851
28815
  curve.mont = mont;
28852
- curve.edwards = edwards;
28816
+ curve.edwards = edwards;
28853
28817
  } (curve));
28854
28818
 
28855
28819
  var curves$1 = {};
@@ -30062,7 +30026,7 @@ Hmac.prototype.digest = function digest(enc) {
30062
30026
  hash.sha224 = hash.sha.sha224;
30063
30027
  hash.sha384 = hash.sha.sha384;
30064
30028
  hash.sha512 = hash.sha.sha512;
30065
- hash.ripemd160 = hash.ripemd.ripemd160;
30029
+ hash.ripemd160 = hash.ripemd.ripemd160;
30066
30030
  } (hash$2));
30067
30031
 
30068
30032
  var secp256k1;
@@ -31059,7 +31023,7 @@ function requireSecp256k1 () {
31059
31023
  '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',
31060
31024
  pre,
31061
31025
  ],
31062
- });
31026
+ });
31063
31027
  } (curves$1));
31064
31028
 
31065
31029
  var hash$1 = hash$2;
@@ -32002,8 +31966,8 @@ function requireElliptic () {
32002
31966
 
32003
31967
  // Protocols
32004
31968
  elliptic.ec = requireEc();
32005
- elliptic.eddsa = eddsa;
32006
- } (elliptic));
31969
+ elliptic.eddsa = eddsa;
31970
+ } (elliptic));
32007
31971
  return elliptic;
32008
31972
  }
32009
31973
 
@@ -33063,7 +33027,7 @@ var der$2 = {};
33063
33027
  0x1d: 'charstr',
33064
33028
  0x1e: 'bmpstr'
33065
33029
  };
33066
- exports.tagByName = reverse(exports.tag);
33030
+ exports.tagByName = reverse(exports.tag);
33067
33031
  } (der$2));
33068
33032
 
33069
33033
  const inherits$3 = require$$3$1;
@@ -33387,7 +33351,7 @@ PEMEncoder.prototype.encode = function encode(data, options) {
33387
33351
  const encoders = exports;
33388
33352
 
33389
33353
  encoders.der = der_1$1;
33390
- encoders.pem = pem$1;
33354
+ encoders.pem = pem$1;
33391
33355
  } (encoders));
33392
33356
 
33393
33357
  var decoders = {};
@@ -33781,7 +33745,7 @@ PEMDecoder.prototype.decode = function decode(data, options) {
33781
33745
  const decoders = exports;
33782
33746
 
33783
33747
  decoders.der = der_1;
33784
- decoders.pem = pem;
33748
+ decoders.pem = pem;
33785
33749
  } (decoders));
33786
33750
 
33787
33751
  (function (exports) {
@@ -33840,7 +33804,7 @@ PEMDecoder.prototype.decode = function decode(data, options) {
33840
33804
 
33841
33805
  Entity.prototype.encode = function encode(data, enc, /* internal */ reporter) {
33842
33806
  return this._getEncoder(enc).encode(data, reporter);
33843
- };
33807
+ };
33844
33808
  } (api));
33845
33809
 
33846
33810
  var base$1 = {};
@@ -33852,7 +33816,7 @@ var base$1 = {};
33852
33816
  base.Reporter = reporter.Reporter;
33853
33817
  base.DecoderBuffer = buffer.DecoderBuffer;
33854
33818
  base.EncoderBuffer = buffer.EncoderBuffer;
33855
- base.Node = node;
33819
+ base.Node = node;
33856
33820
  } (base$1));
33857
33821
 
33858
33822
  var constants = {};
@@ -33877,7 +33841,7 @@ var constants = {};
33877
33841
  return res;
33878
33842
  };
33879
33843
 
33880
- constants.der = der$2;
33844
+ constants.der = der$2;
33881
33845
  } (constants));
33882
33846
 
33883
33847
  (function (exports) {
@@ -33890,7 +33854,7 @@ var constants = {};
33890
33854
  asn1.base = base$1;
33891
33855
  asn1.constants = constants;
33892
33856
  asn1.decoders = decoders;
33893
- asn1.encoders = encoders;
33857
+ asn1.encoders = encoders;
33894
33858
  } (asn1$2));
33895
33859
 
33896
33860
  var asn = asn1$2;
@@ -34264,7 +34228,7 @@ var require$$4 = {
34264
34228
  var hasRequiredSign;
34265
34229
 
34266
34230
  function requireSign () {
34267
- if (hasRequiredSign) return signExports;
34231
+ if (hasRequiredSign) return sign.exports;
34268
34232
  hasRequiredSign = 1;
34269
34233
  // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js
34270
34234
  var Buffer = safeBufferExports.Buffer;
@@ -34407,9 +34371,9 @@ function requireSign () {
34407
34371
  }
34408
34372
 
34409
34373
  sign.exports = sign$1;
34410
- signExports.getKey = getKey;
34411
- signExports.makeKey = makeKey;
34412
- return signExports;
34374
+ sign.exports.getKey = getKey;
34375
+ sign.exports.makeKey = makeKey;
34376
+ return sign.exports;
34413
34377
  }
34414
34378
 
34415
34379
  var verify_1;
@@ -34988,7 +34952,7 @@ function compare$3 (a, b) {
34988
34952
 
34989
34953
  exports.publicDecrypt = function publicDecrypt (key, buf) {
34990
34954
  return exports.privateDecrypt(key, buf, true)
34991
- };
34955
+ };
34992
34956
  } (browser$2));
34993
34957
 
34994
34958
  var browser$1 = {};
@@ -35110,8 +35074,8 @@ function requireCryptoBrowserify () {
35110
35074
  cryptoBrowserify.createHash = cryptoBrowserify.Hash = browser$a;
35111
35075
  cryptoBrowserify.createHmac = cryptoBrowserify.Hmac = browser$9;
35112
35076
 
35113
- var algos = algosExports;
35114
- var algoKeys = Object.keys(algos);
35077
+ var algos$1 = algos;
35078
+ var algoKeys = Object.keys(algos$1);
35115
35079
  var hashes = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160'].concat(algoKeys);
35116
35080
  cryptoBrowserify.getHashes = function () {
35117
35081
  return hashes
@@ -38032,7 +37996,7 @@ async function visMerkleClock (blocks, head) {
38032
37996
  return { vis: lines.join('\n') }
38033
37997
  }
38034
37998
 
38035
- var charwise = {};
37999
+ var charwise$1 = {};
38036
38000
 
38037
38001
  var number = {};
38038
38002
 
@@ -38260,8 +38224,10 @@ object.factory = function (codec) {
38260
38224
 
38261
38225
  //for leveldb, request strings
38262
38226
  exports.buffer = false;
38263
- exports.type = 'charwise';
38264
- } (charwise));
38227
+ exports.type = 'charwise';
38228
+ } (charwise$1));
38229
+
38230
+ var charwise = /*@__PURE__*/getDefaultExportFromCjs(charwise$1);
38265
38231
 
38266
38232
  /* global localStorage */
38267
38233
  let storageSupported = false;
@@ -39313,11 +39279,7 @@ async function loadIndex (blocks, index, indexOpts) {
39313
39279
  return index.root
39314
39280
  }
39315
39281
 
39316
- var browserExports = {};
39317
- var browser = {
39318
- get exports(){ return browserExports; },
39319
- set exports(v){ browserExports = v; },
39320
- };
39282
+ var browser = {exports: {}};
39321
39283
 
39322
39284
  /**
39323
39285
  * Helpers.
@@ -40033,8 +39995,10 @@ var common = setup;
40033
39995
  } catch (error) {
40034
39996
  return '[UnexpectedJSONParseError]: ' + error.message;
40035
39997
  }
40036
- };
40037
- } (browser, browserExports));
39998
+ };
39999
+ } (browser, browser.exports));
40000
+
40001
+ var browserExports = browser.exports;
40038
40002
 
40039
40003
  // originally pulled out of simple-peer
40040
40004
 
@@ -41185,6 +41149,8 @@ Peer.channelConfig = {};
41185
41149
 
41186
41150
  var simplePeer = Peer;
41187
41151
 
41152
+ var SimplePeer = /*@__PURE__*/getDefaultExportFromCjs(simplePeer);
41153
+
41188
41154
  /**
41189
41155
  * @typedef {import('./database.js').Database} Database
41190
41156
  */
@@ -41196,7 +41162,7 @@ class Sync {
41196
41162
  * @static
41197
41163
  */
41198
41164
  status = 'new'
41199
- constructor (database, PeerClass = simplePeer) {
41165
+ constructor (database, PeerClass = SimplePeer) {
41200
41166
  this.database = database;
41201
41167
  this.database.blocks.syncs.add(this); // should this happen during setup?
41202
41168
  this.PeerClass = PeerClass;
@@ -41337,7 +41303,7 @@ class Sync {
41337
41303
  destroy () {
41338
41304
  this.database.blocks.syncs.delete(this);
41339
41305
  this.status = 'destroyed';
41340
- this.peer.destroy();
41306
+ // this.peer.destroy() todo
41341
41307
  }
41342
41308
 
41343
41309
  async sendUpdate (blockstore) {
@@ -41434,7 +41400,7 @@ class Fireproof {
41434
41400
  const fp = new Database(new TransactionBlockstore(name, existingConfig.key), [], opts);
41435
41401
  return Fireproof.fromJSON(existingConfig, fp)
41436
41402
  } else {
41437
- const instanceKey = browserExports$1(32).toString('hex'); // pass null to disable encryption
41403
+ const instanceKey = randomBytes$3(32).toString('hex'); // pass null to disable encryption
41438
41404
  return new Database(new TransactionBlockstore(name, instanceKey), [], opts)
41439
41405
  }
41440
41406
  } else {