Skip to content

Instantly share code, notes, and snippets.

@federico-garcia
Last active July 17, 2017 21:40
Show Gist options
  • Save federico-garcia/5ec0d86b3395271fa07cbefe264e5233 to your computer and use it in GitHub Desktop.
Save federico-garcia/5ec0d86b3395271fa07cbefe264e5233 to your computer and use it in GitHub Desktop.
Checksum

cyclic redundancy check. crc32 is supposed to be faster than shasum, you should only use shasum if the output of crc32 for two files is equal, otherwise, you are safe to say the two files are not equal.

crc32 /path/to/file
md5 file.iso
md5 /path/to/file

shasum -a 1 file.iso
shasum -a 1 /path/to/file

shasum -a 256 file.dmg
shasum -a 256 /path/to/file
echo "secret-string" | shasum -a 256
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment