Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@guildofweavers/merkle

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@guildofweavers/merkle - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

1

index.js

@@ -9,2 +9,3 @@ "use strict";

exports.getHashDigestSize = hash_1.getHashDigestSize;
exports.getHashFunction = hash_1.getHashFunction;
//# sourceMappingURL=index.js.map

42

merkle.d.ts
declare module '@guildofweavers/merkle' {
/**
* Algorithms that can be used to hash internal tree nodes
*/
/** Algorithms that can be used to hash internal tree nodes */
export type HashAlgorithm = 'sha256' | 'blake2s256';
/**
* Returns digest size (in bytes) for the specified hash algorithm
* @param hashAlgorithm
*/
/** Returns digest size (in bytes) for the specified hash algorithm */
export function getHashDigestSize(hashAlgorithm: HashAlgorithm): number;
export interface BatchMerkleProof {
/** leaf nodes located at the indexes covered by the proof */
values: Buffer[];
/** Returns a hash function for the specified algorithm */
export function getHashFunction(hashAlgorithm: HashAlgorithm): HashFunction;
/** Internal nodes that form the actual proof */
nodes: Buffer[][];
/** Depth of the source Merkle tree */
depth: number;
}
export class MerkleTree {

@@ -47,12 +34,6 @@

/**
* Returns a Merkle proof for a single leaf
* @param index Index at which the leaf is located
*/
/** Returns a Merkle proof for a single leaf at the specified index */
prove(index: number): Buffer[];
/**
* Returns a compressed Merkle proof for leaves at the specified indexes
* @param indexes List of indexes of leaves to prove
*/
/** Returns a compressed Merkle proof for leaves at the specified indexes */
proveBatch(indexes: number[]): BatchMerkleProof;

@@ -79,2 +60,13 @@

export interface BatchMerkleProof {
/** leaf nodes located at the indexes covered by the proof */
values: Buffer[];
/** Internal nodes that form the actual proof */
nodes: Buffer[][];
/** Depth of the source Merkle tree */
depth: number;
}
export interface HashFunction {

@@ -81,0 +73,0 @@ (v1: Buffer, v2?: Buffer): Buffer;

{
"name": "@guildofweavers/merkle",
"version": "0.1.1",
"version": "0.1.2",
"description": "Merkle tree and other data structures",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc