Skip to content

Commit

Permalink
Remove sri-toolbox dependency.
Browse files Browse the repository at this point in the history
We can achieve the same very easily.
  • Loading branch information
XhmikosR committed Oct 14, 2018
1 parent b2b933c commit 3fcddfa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
8 changes: 4 additions & 4 deletions build/generate-sri.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/

const crypto = require('crypto')
const fs = require('fs')
const path = require('path')
const sriToolbox = require('sri-toolbox')
const sh = require('shelljs')

sh.config.fatal = true
Expand Down Expand Up @@ -47,9 +47,9 @@ files.forEach((file) => {
throw err
}

const integrity = sriToolbox.generate({
algorithms: ['sha384']
}, data)
const algo = 'sha384'
const hash = crypto.createHash(algo).update(data, 'utf8').digest('base64')
const integrity = `${algo}-${hash}`

console.log(`${file.configPropertyName}: ${integrity}`)

Expand Down
6 changes: 0 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@
"shelljs": "^0.8.2",
"shx": "^0.3.2",
"sinon": "^6.3.5",
"sri-toolbox": "^0.2.0",
"stylelint": "^9.6.0",
"stylelint-config-recommended-scss": "^3.2.0",
"stylelint-config-standard": "^18.2.0",
Expand Down

0 comments on commit 3fcddfa

Please sign in to comment.