zero-knowledge/src/main/java/com/hedera/hashgraph/zeroknowledge/utils/MerkleTreeUtils.java
/**
     * Computes the Poseidon hash of the documentId and the merkleTreeRoot.
     *
     * @param documentId The documentId to be hashed.
     * @param merkleTreeRoot The merkleTreeRoot to be hashed.
     * @return The hash of documentId and merkleTreeRoot as a FieldElement.
     * @throws FinalizationException An exception that can occur during the hash finalize step; it means one of the two arguments was not in the correct format.
     */
Computes the Poseidon hash of the documentId and the merkleTreeRoot.
@param documentId The documentId to be hashed.
@param merkleTreeRoot The merkleTreeRoot to be hashed.
@return The hash of documentId and merkleTreeRoot as a FieldElement.
@throws FinalizationException An exception that can occur during the hash finalize step; it means one of the two arguments was not in the correct format.
Computes the Poseidon hash of the documentId and the merkleTreeRoot . @param documentId The documentId to be hashed . @param merkleTreeRoot The merkleTreeRoot to be hashed . @return The hash of documentId and merkleTreeRoot as a FieldElement . @throws FinalizationException An exception that can occur during the hash finalize step ; it means one of the two arguments was not in the correct format .
public static FieldElement computeHash(FieldElement documentId, FieldElement merkleTreeRoot) throws FinalizationException {
        try (PoseidonHash hash = PoseidonHash.getInstanceConstantLength(2)) {
            hash.update(documentId);
            hash.update(merkleTreeRoot);
            return hash.finalizeHash();
        }
    }
public static FieldElement computeHash ( FieldElement documentId , FieldElement merkleTreeRoot ) throws FinalizationException { try ( PoseidonHash hash = PoseidonHash . getInstanceConstantLength ( 2 ) ) { hash . update ( documentId ) ; hash . update ( merkleTreeRoot ) ; return hash . finalizeHash ( ) ; } }
Computes the Poseidon hash of the documentId and the merkleTreeRoot.
Computes the Poseidon hash of the documentId and the merkleTreeRoot .