Hi Sarthak Verma, Thanks for following along! So I have included the sha256.js file in a script tag in the body of the html file, and then the blockchain.js file (in that order).
The blockchain.js functions can then access everything from the preceding file as they are both imported into index.html.
I hope that clears things up. Good luck on your cryptojourney!
Great article, but how are you able to use the
SHA256function without importing it intoblockchain.js?By doing as you instructed, I am getting this error in the console.
blockchain.js:6 Uncaught ReferenceError: SHA256 is not defined at new Block (blockchain.js:6) at new Blockchain (blockchain.js:24) at <anonymous>:1:18