zPass docs
  • zPass
    • Introduction
    • Quickstart
    • Background
    • Benefits & Use Cases
    • Technical Foundations
    • System Participants
    • Powered by Aleo
  • Fundamentals
    • Issuer
    • Holder
    • Verifier
    • Off-chain flow
    • On-chain flow
    • Local Execution with WASM
  • ZPass Programs
    • Background
    • Verify offchain program
    • zPass issuance program
    • zPass hiding program
    • zPass invalidate program
    • zPass invalidate hiding program
    • zPass merkle tree size 8 program
  • ZPass SDK
    • Methods References
      • constructor
      • setNewHost
      • issueZPass
      • getZPassRecord
      • proveOnChain
      • proveOffChain
      • verifyOnChain
      • verifyOffChain
      • signCredential
      • initThreadPool
      • createAleoWorker
      • getMerkleRoot
      • getMerkleTree
      • getMerkleProof
      • getLeavesHashes
      • signMerkleRoot
  • Example Usage
    • Step-by-step Guide
Powered by GitBook
On this page
  1. ZPass SDK
  2. Methods References

getLeavesHashes

Description The getLeavesHashes method hashes the input values to generate leaf hashes for the Merkle tree.

Parameters

  • inputs (string[]): An array of strings representing the raw data for the leaves.

Returns Returns a Promise that resolves to a string[] containing the hashed leaf nodes. Always append to size of 8 with 0field if data length is < 8.

Example

const hashes = await sdk.getLeavesHashes(["data1", "data2", "data3"]);
console.log("Leaf Hashes:", hashes);
PreviousgetMerkleProofNextsignMerkleRoot

Last updated 2 months ago