# Where to find sha256 utility source code



## ipizhenko (Jan 2, 2022)

FreeBSD provides set of utilities for computing SHA-2 hashes (sha256, sha512, etc). I want to find their source code. I don't need source code of the SHA-256 hash function itself, but I am looking for source code of the command-line utility, i.e. part which processes command-line options, input files, etc. I've cloned latest FreeBSD source code from the GitHub-based mirror, and searched for "sha256" over the whole repo, and it gave me a lot of matches, but still I couldn't find that exact one. Please point me, where I can find it, if you know.


----------



## ipizhenko (Jan 2, 2022)

Update: found sbin/md5/md5.c which handles all these types of hashes in addition to MD5 itself.


----------



## covacat (Jan 2, 2022)

/usr/src/lib/libmd


----------



## eternal_noob (Jan 2, 2022)

freebsd-src/lib/libmd at main · freebsd/freebsd-src
					

FreeBSD src tree (read-only mirror). Contribute to freebsd/freebsd-src development by creating an account on GitHub.




					github.com


----------



## shkhln (Jan 2, 2022)

It's sbin/md5, which you can find in less than a minute if you grep makefiles.


----------

