You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
290 B

5 years ago
  1. const Poseidon = require("./poseidon");
  2. const bigInt = require("snarkjs").bigInt;
  3. const hash = Poseidon.createHash(6, 8, 57);
  4. exports.hash0 = function (left, right) {
  5. return hash([left, right]);
  6. };
  7. exports.hash1 = function(key, value) {
  8. return hash([key, value, bigInt.one]);
  9. };