srisum(1) -- compute and check subresource integrity digests
$ srisum [OPTION]... [FILE]...
Computing SRI Digests
For a single file:
$ srisum styles.css > styles.css.sri
For multiple different files:
$ srisum styles.css index.js package.json bundle.js > app.sri
$ cat styles.css | srisum -a sha1 sha1-hmkHOZdrfLUVOqpAgryfC8XNGtE -
Specify algorithms to generate:
$ srisum styles.css index.js --algorithms sha512 sha256 sha1 > styles.css.sri
Passing checksum file as an argument:
$ srisum -c styles.css.sri styles.css: OK (sha512)
Passing multiple checksum files:
$ srisum -c styles.css.sri js-files.sri styles.css: OK (sha512) index.js: OK (sha512) lib/util.js: OK (sha512)
Checksum file from
$ cat styles.css.sri | srisum -c styles.css: OK (sha512)
$ echo "hello" | srisum > stdin.sri $ echo "hello" | srisum -c stdin.sri -: OK (sha512)
Print or check Subresource Integrity digests.
srisum's API is based on the
SHA[N]SUM(1) family of unix utilities.
FILE or when
-, read standard input.
-a, --algorithms [ALGO]... - hash algorithms to generate for the
-c, --check - read SRI sums from the
FILEs and check them
-d, --digest-only - only output the digest for each
FILE, without filenames
--help - display help and exit
--version - output version information and exit
The following options are useful only when verifying integrity:
--ignore-missing - don't fail or report status for missing files
--quiet - don't print OK for each successfully verified file
--status - don't output anything, status code shows success
-w, --warn - warn about improperly formatted SRI lines
When checking, the input should be a former output of this program. The default mode is to print line with space-separated SRI digests, one more space, and a name for each FILE.
Strict mode, enabled with
--strict, will entirely ignore digests (in input and output) that fail all of the following conditions:
algorithmsmust be one or more of:
- digest strings must be valid
Written by Kat Marchan
The srisum team enthusiastically welcomes contributions and project participation! There's a bunch of things you can do if you want to contribute! The Contributor Guide has all the information you need for everything from reporting bugs to contributing entire new features. Please don't hesitate to jump in if you'd like to, or even ask us questions if something isn't clear.
All participants and maintainers in this project are expected to follow Code of Conduct, and just generally be excellent to each other.
The Parity License is a copyleft license that, unlike the GPL family, allows you to license derivative and connected works under permissive licenses like MIT or Apache-2.0. It's free to use provided the work you do is freely available!
For proprietary use, please contact me, or just sponsor me on GitHub under the appropriate tier to acquire a proprietary-use license! This funding model helps me make my work sustainable and compensates me for the work it took to write this crate!