# How to calculate file/directory hash?

**URL:** <https://discuss.ipfs.tech/t/how-to-calculate-file-directory-hash/777>\
**Category:** Help\
**Created:** [July 15, 2017, 12:20pm UTC](https://discuss.ipfs.tech/t/how-to-calculate-file-directory-hash/777 "2017-07-15T12:20:11Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Nyan](https://avatars.discourse-cdn.com/v4/letter/n/ac91a4/32.png) [@Nyan](https://discuss.ipfs.tech/u/Nyan)\
**Post date:** [July 16, 2017, 12:40am UTC](https://discuss.ipfs.tech/t/how-to-calculate-file-directory-hash/777/3 "2017-07-16T00:40:41Z")

</div>

> [@flyingzumwalt](#):
>
> Are you asking how to do this in code rather than from the command line?

Yes, sorry for not making that clear. To put it another way, is there some specification/guide on how I would write a program to basically do the same thing as `ipfs add -n` ?

Thank you for the response by the way.

---

_[View the full topic](https://discuss.ipfs.tech/t/how-to-calculate-file-directory-hash/777)._
