Which alternatives to OpenSSL do I have to calculate a SHA-256 hash? How to calculate SHA-2 hash on a file to generate a 256-bit result (SHA-256)?

In the old days we used the openssl tool. I have heard that after terrible security vulnerabilities with openssl, the world has moved on to alternative tools. Does macOS Sierra ship with alternatives to openssl? What is the modern approach to running a SHA-256 hash?
shasum

You can just use shasum:

shasum -a 256 FILE.txt



The shasum is the name of the command. 
The -a option means algorithm. 
The 256 specifies use of the 256-bit algorithm.