SHARE
TWEET

Untitled

a guest Sep 17th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function verifyProof(proof, node, root, concat) {
  2.     for(let i = 0; i < proof.length; i++) {
  3.         let { left, data } = proof[i];
  4.         if(left) {
  5.             node = concat(data, node);
  6.         }
  7.         else {
  8.             node = concat(node, data);
  9.         }
  10.     }
  11.     return root.equals(node);
  12. }
  13.  
  14. module.exports = verifyProof;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top