UNPKG

zk-threshold-proof

Version:

A lightweight SDK to generate and verify ZK proofs that assert a private value is greater than or equal to a threshold.

12 lines (8 loc) 264 B
const crypto = require('crypto'); function getCommitmentHash(publicSignals) { const hash = crypto.createHash('sha256'); const data = publicSignals.join(','); hash.update(data); return '0x' + hash.digest('hex'); } module.exports = { getCommitmentHash };