Create a checksum file for all files within a directory:

$ shasum * > checksum

Check the checksum:

$ shasum -c checksum

To use sha256:

$ shasum -a 256 * > checksum