# Import Sha256 "mo:sha256/SHA256";

**URL:** <https://forum.dfinity.org/t/import-sha256-mo-sha256-sha256/6533>\
**Category:** Developers\
**Created:** [August 17, 2021, 4:18pm UTC](https://forum.dfinity.org/t/import-sha256-mo-sha256-sha256/6533 "2021-08-17T16:18:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ehsan6sha](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/ehsan6sha/32/2460_2.png) [@ehsan6sha](https://forum.dfinity.org/u/ehsan6sha)\
**Post date:** [August 17, 2021, 4:18pm UTC](https://forum.dfinity.org/t/import-sha256-mo-sha256-sha256/6533/1 "2021-08-17T16:18:44Z")

</div>

HI  
I have a basic question. I want to use mo:sha256 library and tested the import in motoko playground and it works. however, in my server, it complains that the library does not exist. How can I add this library so that I can import it?  
import Sha256 “mo:sha256/SHA256”;

I know it should be through vessel or in dfx.json dependencies, but not sure how

---

<div class="post-metadata">

**Author:** ![ehsan6sha](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/ehsan6sha/32/2460_2.png) [@ehsan6sha](https://forum.dfinity.org/u/ehsan6sha)\
**Post date:** [August 17, 2021, 4:30pm UTC](https://forum.dfinity.org/t/import-sha256-mo-sha256-sha256/6533/2 "2021-08-17T16:30:43Z")

</div>

I tried setting it in dependencies of vessel.dhall but got this error while deploying:

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/a/a0b52ea6a935950caeb836750055ae8aa27b4451.png)

---

<div class="post-metadata">

**Author:** ![ehsan6sha](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/ehsan6sha/32/2460_2.png) [@ehsan6sha](https://forum.dfinity.org/u/ehsan6sha)\
**Post date:** [August 17, 2021, 5:00pm UTC](https://forum.dfinity.org/t/import-sha256-mo-sha256-sha256/6533/3 "2021-08-17T17:00:06Z")

</div>

Ah, found the issue, should also have added it in package-set.dhal

---

<div class="post-metadata">

**Author:** ![Iceypee](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/iceypee/32/5362_2.png) [@Iceypee](https://forum.dfinity.org/u/Iceypee)\
**Post date:** [June 7, 2022, 8:46pm UTC](https://forum.dfinity.org/t/import-sha256-mo-sha256-sha256/6533/4 "2022-06-07T20:46:57Z")

</div>

what version did you use in you packageset? I couldnt find a version?

---

<div class="post-metadata">

**Author:** ![blabagastered](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/blabagastered/32/8592_2.png) [@blabagastered](https://forum.dfinity.org/u/blabagastered)\
**Post date:** [January 10, 2023, 11:56am UTC](https://forum.dfinity.org/t/import-sha256-mo-sha256-sha256/6533/5 "2023-01-10T11:56:42Z")

</div>

Other than adding

`import SHA256 "mo:sha256/SHA256";` in main.mo or wherever you’re using it,

exactly what else needs to be done (npm installs, config changes, etc) to be able to use it?

I’m getting package `"sha256" not defined Motoko`

Timo says it should be part of the standard packages now: ["SHA256/lib.mo" does not exist · Issue #10 · enzoh/motoko-sha · GitHub](https://github.com/enzoh/motoko-sha/issues/10#issuecomment-971504009)

Do I have an old version of something?

---

<div class="post-metadata">

**Author:** ![skilesare](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/skilesare/32/5609_2.png) [@skilesare](https://forum.dfinity.org/u/skilesare)\
**Post date:** [January 10, 2023, 1:28pm UTC](https://forum.dfinity.org/t/import-sha256-mo-sha256-sha256/6533/6 "2023-01-10T13:28:35Z")

</div>

I’d suggest: [GitHub - aviate-labs/crypto.mo: Crypto Package for Motoko](https://github.com/aviate-labs/crypto.mo)

You should use vessel and/or mops for package management.

Vessel is super simple…you just add delcarations that point to the github repo and the version…if the code is under ‘/src’ then it ‘just works’.

> **[GitHub - dfinity/vessel: Simple package management for Motoko](https://github.com/dfinity/vessel)**
>
> Simple package management for Motoko. Contribute to dfinity/vessel development by creating an account on GitHub.
