I recently got into trying to learn about cryptography and found out about SHA-2 (SHA-256 in particular) and am unable to find an actual algorithm that goes through the hashing steps in particular. If someone has a working algorithm for JavaScript to put a string through SHA-256 hashing that would be helpful.
I know it may not be possible, but I am attempting to learn how SHA-256 hashes strings in order to attempt to try to reverse SHA-256.
NOTE: I realize that this is the most common form of security hashing and in no way am I attempting to do harmful acts with this knowledge (if I succeed).
Edit1: If possible, I'd like the SHA-256 algorithm to fit within a single .js file. I am implementing the SHA-256 into a Tampermonkey script for myself, and want to also try to learn to reverse it.