Anton Shestakov <av6@dwimlabs.net>, Wed, 25 May 2016 21:04:11 +0800
contrib: and ad-hoc script to update SRI hashes
contrib/updatesri.sh
Permissions: -rwxr-xr-x
egrep -oh
'https://[^"]+\.js' "$@" | sort -u
| while read url
; do hash=`curl -fsS
"$url" | openssl dgst -sha384 -binary
| openssl base64 -A
` sed -i
"\|$url| c\\ <script src=\"$url\" integrity=\"sha384-$hash\" crossorigin=\"anonymous\"></script>" "$@"egrep -oh
'https://[^"]+\.css' "$@" | sort -u
| while read url
; do hash=`curl -fsS
"$url" | openssl dgst -sha384 -binary
| openssl base64 -A
` sed -i
"\|$url| c\\ <link rel=\"stylesheet\" href=\"$url\" integrity=\"sha384-$hash\" crossorigin=\"anonymous\">" "$@"