mirror of
https://github.com/tornadocash/tornado-cli.git
synced 2024-12-25 15:49:33 -05:00
14 lines
315 B
JavaScript
14 lines
315 B
JavaScript
|
const circomlib = require('circomlib')
|
||
|
const mimcsponge = circomlib.mimcsponge
|
||
|
const snarkjs = require('snarkjs')
|
||
|
|
||
|
const bigInt = snarkjs.bigInt
|
||
|
|
||
|
class MimcSpongeHasher {
|
||
|
hash(level, left, right) {
|
||
|
return mimcsponge.multiHash([bigInt(left), bigInt(right)]).toString()
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = MimcSpongeHasher
|