Remote file:

curl -L -s http://path/to/remote/file | shasum -a 256 | cut -c-12

Local file:

shasum -a 256 /path/to/file | cut -c-12