@fireproof/core 0.3.16 → 0.3.18
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/dist/main.js +2 -0
- package/dist/main.js.LICENSE.txt +17 -0
- package/dist/src/index.js +2 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.mjs +1 -1
- package/dist/src/index.mjs.map +1 -1
- package/package.json +11 -5
- package/src/fireproof.js +1 -1
@@ -0,0 +1,17 @@
|
|
1
|
+
/*!
|
2
|
+
* The buffer module from node.js, for the browser.
|
3
|
+
*
|
4
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
5
|
+
* @license MIT
|
6
|
+
*/
|
7
|
+
|
8
|
+
/*!
|
9
|
+
* The buffer module from node.js, for the browser.
|
10
|
+
*
|
11
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
12
|
+
* @license MIT
|
13
|
+
*/
|
14
|
+
|
15
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
16
|
+
|
17
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
package/dist/src/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
var
|
3
|
+
var randomBytes = require('randombytes');
|
4
4
|
var Block = require('multiformats/block');
|
5
5
|
var sha2 = require('multiformats/hashes/sha2');
|
6
6
|
var dagcbor = require('@ipld/dag-cbor');
|
@@ -1015,7 +1015,7 @@ class Fireproof {
|
|
1015
1015
|
* @returns {Fireproof} - a new Fireproof instance
|
1016
1016
|
*/
|
1017
1017
|
static storage = (name = "global") => {
|
1018
|
-
const instanceKey =
|
1018
|
+
const instanceKey = randomBytes(32).toString("hex");
|
1019
1019
|
return new Fireproof(new TransactionBlockstore(name, instanceKey), [], { name });
|
1020
1020
|
};
|
1021
1021
|
constructor(blocks, clock, config, authCtx = {}) {
|