Generate checksum for a file or a directory via a globbing pattern.
Default is MD5, but SHA-1, SHA-256, and SHA-512 can also be used.
.
{code:bash}
checksum file.txt
checksum build.zip SHA-256
{code}
Create a checksum for more than one file in a directory with a file globbing pattern
.
{code:bash}
checksum path=*.zip
{code}
Write checksum(s) to a file named after the original file plus a new extension.
This will create a file called "myFile.zip.md5".
.
{code:bash}
checksum myFile.zip md5 --write
{code}
Control the file extension like so. (--write is optional when supplying an extension)
This will create a file called "myFile.zip.hash".
.
{code:bash}
checksum path=myFile.zip extension=hash --write
{code}
Control the format of the hash with the "format" parameter.
{code:bash}
- "checksum" (default) -- just the hash
- "md5sum" -- The format of GNU textutils md5sum
- "sfv" -- The format of BSDs md5 command
{code}
Verify a file against an existing hash. Error will be thrown if checksums are different
.
{code:bash}
checksum path=myFile.zip verify=2A95F32028087699CCBEB09AFDA0348C
{code}