sri-toolbox
Subresource Integrity tools.
Install
npm install sri-toolbox
Usage
var sriToolbox = require("sri-toolbox");
var jquerySourceCode = file("jquery-1.10.2.min.js");
var integrity = sriToolbox.generate({
type: "application/javascript",
algorithms: ["sha256"],
}, jquerySourceCode);
API
generate
Generate creates a Sub-resource Integrity attribute from a data string.
Options
Key: type name = default
-
array algorithms = ["sha256"]
List of hashing algorithms
-
string delimiter = " "
Integrity attribute delimiter
-
string type = ""
Content-type of file