@chainsafe/persistent-merkle-tree
Advanced tools
Comparing version 0.5.0 to 0.6.0
@@ -6,2 +6,16 @@ # Change Log | ||
## [0.6.0](https://github.com/ChainSafe/ssz/compare/persistent-merkle-tree-v0.5.0...persistent-merkle-tree-v0.6.0) (2023-04-05) | ||
### Features | ||
* add swappable hasher, default to noble-hashes ([#314](https://github.com/ChainSafe/ssz/issues/314)) ([4b44614](https://github.com/ChainSafe/ssz/commit/4b44614003619b2c5477363a3c85287e2f2987bd)) | ||
### Dependencies | ||
* The following workspace dependencies were updated | ||
* dependencies | ||
* @chainsafe/as-sha256 bumped to 0.4.0 | ||
## [0.5.0](https://github.com/ChainSafe/ssz/compare/persistent-merkle-tree-v0.4.2...persistent-merkle-tree-v0.5.0) (2023-01-24) | ||
@@ -8,0 +22,0 @@ |
export * from "./gindex"; | ||
export * from "./hash"; | ||
export * from "./hasher"; | ||
export * from "./node"; | ||
@@ -4,0 +4,0 @@ export * from "./packedNode"; |
@@ -14,3 +14,3 @@ "use strict"; | ||
__exportStar(require("./gindex"), exports); | ||
__exportStar(require("./hash"), exports); | ||
__exportStar(require("./hasher"), exports); | ||
__exportStar(require("./node"), exports); | ||
@@ -17,0 +17,0 @@ __exportStar(require("./packedNode"), exports); |
@@ -1,2 +0,2 @@ | ||
import { HashObject } from "@chainsafe/as-sha256"; | ||
import { HashObject } from "@chainsafe/as-sha256/hashObject"; | ||
/** | ||
@@ -3,0 +3,0 @@ * An immutable binary merkle tree node |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.bitwiseOrNodeH = exports.setNodeH = exports.getNodeH = exports.compose = exports.identity = exports.LeafNode = exports.BranchNode = exports.Node = void 0; | ||
const hash_1 = require("./hash"); | ||
const hasher_1 = require("./hasher"); | ||
const TWO_POWER_32 = 2 ** 32; | ||
@@ -50,3 +50,3 @@ /** | ||
if (this.h0 === null) { | ||
super.applyHash(hash_1.hashTwoObjects(this.left.rootHashObject, this.right.rootHashObject)); | ||
super.applyHash(hasher_1.hasher.digest64HashObjects(this.left.rootHashObject, this.right.rootHashObject)); | ||
} | ||
@@ -56,3 +56,3 @@ return this; | ||
get root() { | ||
return hash_1.hashObjectToUint8Array(this.rootHashObject); | ||
return hasher_1.hashObjectToUint8Array(this.rootHashObject); | ||
} | ||
@@ -75,3 +75,3 @@ isLeaf() { | ||
static fromRoot(root) { | ||
return this.fromHashObject(hash_1.uint8ArrayToHashObject(root)); | ||
return this.fromHashObject(hasher_1.uint8ArrayToHashObject(root)); | ||
} | ||
@@ -106,3 +106,3 @@ /** | ||
get root() { | ||
return hash_1.hashObjectToUint8Array(this); | ||
return hasher_1.hashObjectToUint8Array(this); | ||
} | ||
@@ -109,0 +109,0 @@ isLeaf() { |
{ | ||
"name": "@chainsafe/persistent-merkle-tree", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "Merkle tree implemented as a persistent datastructure", | ||
"main": "lib/index.js", | ||
"exports": { | ||
".": "./lib/index.js", | ||
"./hasher": "./lib/hasher/index.js", | ||
"./hasher/as-sha256": "./lib/hasher/as-sha256.js", | ||
"./hasher/noble": "./lib/hasher/noble.js" | ||
}, | ||
"typesVersions": { | ||
"*": { | ||
"*": [ | ||
"*", | ||
"lib/*", | ||
"lib/*/index" | ||
] | ||
} | ||
}, | ||
"files": [ | ||
@@ -38,4 +53,5 @@ "lib" | ||
"dependencies": { | ||
"@chainsafe/as-sha256": "^0.3.1" | ||
"@chainsafe/as-sha256": "^0.4.0", | ||
"@noble/hashes": "^1.3.0" | ||
} | ||
} |
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
122257
40
2686
2
+ Added@noble/hashes@^1.3.0
+ Added@chainsafe/as-sha256@0.4.2(transitive)
+ Added@noble/hashes@1.5.0(transitive)
- Removed@chainsafe/as-sha256@0.3.1(transitive)
Updated@chainsafe/as-sha256@^0.4.0