---
title: "Comment by Sarthak Verma on \"Building a Simple JavaScript Blockchain\" | Hashnode"
description: "Great article, but how are you able to use the SHA256 function without importing it into blockchain.js ? By doing as you instructed, I am getting this error in"
url: "https://hashnode.com/posts/building-a-simple-javascript-blockchain/61199742ac5c985f36436e89/comment/612f6478bb796223ef279950"
---

[Discussion](https://hashnode.com/posts/building-a-simple-javascript-blockchain/61199742ac5c985f36436e89)

Comment [Building a Simple JavaScript Blockchain](https://hashnode.com/posts/building-a-simple-javascript-blockchain/61199742ac5c985f36436e89)

[Sarthak Verma](https://hashnode.com/@sarthakv)

[Sep 1, 2021](https://hashnode.com/posts/building-a-simple-javascript-blockchain/61199742ac5c985f36436e89/comment/612f6478bb796223ef279950)

Great article, but how are you able to use the `SHA256` function without importing it into `blockchain.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
```

[Andrew Bruner](https://hashnode.com/@andrewbruner)

[Sep 27, 2021](https://hashnode.com/posts/building-a-simple-javascript-blockchain/61199742ac5c985f36436e89/comment/612f6478bb796223ef279950#reply-61521117040ee8723695066c)

Hi [Sarthak Verma](https://hashnode.com/@sarthakv), 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!
