natemcmaster - srihash-cli 0.1.10

A command line tool for generating the SRI hash for browsers.

PM> Install-Package srihash-cli -Version 0.1.10 -Source https://www.myget.org/F/natemcmaster/api/v3/index.json

Copy to clipboard

> nuget.exe install srihash-cli -Version 0.1.10 -Source https://www.myget.org/F/natemcmaster/api/v3/index.json

Copy to clipboard

> dotnet tool install -g srihash-cli --version 0.1.10 --add-source https://www.myget.org/F/natemcmaster/api/v3/index.json

Copy to clipboard
<DotNetCliToolReference Include="srihash-cli" Version="0.1.10" />
Copy to clipboard
source https://www.myget.org/F/natemcmaster/api/v3/index.json

nuget srihash-cli  ~> 0.1.10
Copy to clipboard

> choco install srihash-cli --version 0.1.10 --source https://www.myget.org/F/natemcmaster/api/v2

Copy to clipboard
Import-Module PowerShellGet
Register-PSRepository -Name "natemcmaster" -SourceLocation "https://www.myget.org/F/natemcmaster/api/v2"
Install-Module -Name "srihash-cli" -RequiredVersion "0.1.10" -Repository "natemcmaster" 
Copy to clipboard

srihash-cli

A command-line utility for generating the hash used for subresource integrity (SRI) checks in modern browsers.

Example:

<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.3.1.min.js"
        integrity="sha384-tsQFqpEReu7ZLhBV2VZlAu7zcOV+rXbYlF2cqB8txI/8aZajjp4Bqd+V6D5IgvKT" 
        crossorigin="anonymous">
</script>

Get started

Install:

$ dotnet tool install -g srihash-cli

Generate the hash:

$ srihash https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.3.1.min.js
sha384-ifv0TYDWxBHzvAk2Z0n8R434FL1Rlv/Av18DXE43N/1rvHyOG4izKst0f2iSLdds

Generate the full HTML tag:

$ srihash --html https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.3.1.min.js
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.3.1.min.js" integrity="sha384-tsQFqpEReu7ZLhBV2VZlAu7zcOV+rXbYlF2cqB8txI/8aZajjp4Bqd+V6D5IgvKT" crossorigin="anonymous"></script>
  • .NETCoreApp 2.1: 2.1.0.0

Owners

Nate McMaster

Authors

Nate McMaster

Project URL

https://github.com/natemcmaster/srihash-cli

License

Apache-2.0

Tags

sri cli sri hash subresource integrity

Info

16 total downloads
4 downloads for version 0.1.10
Download (68.7 KB)
Found on the current feed only

Package history

Version Size Last updated Downloads Mirrored?
0.1.11 68.69 KB Sat, 17 Aug 2019 21:07:39 GMT 1
0.1.10 68.7 KB Sat, 17 Aug 2019 05:12:33 GMT 4
0.1.1 76.8 KB Wed, 16 May 2018 21:09:05 GMT 2
0.1.1-build.5 76.81 KB Thu, 17 May 2018 15:29:58 GMT 1
0.1.1-build.3 76.81 KB Wed, 16 May 2018 20:51:47 GMT 1
0.1.0 76.81 KB Tue, 15 May 2018 23:42:49 GMT 2
0.1.0-build.1 76.81 KB Tue, 15 May 2018 23:27:50 GMT 5