Remove sri-toolbox dependency.

We can achieve the same very easily.
This commit is contained in:
XhmikosR 2018-10-13 16:40:38 +03:00
parent b2b933c181
commit 3fcddfa42e
3 changed files with 4 additions and 11 deletions

View File

@ -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
@ -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}`)

6
package-lock.json generated
View File

@ -9920,12 +9920,6 @@
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
"dev": true
},
"sri-toolbox": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/sri-toolbox/-/sri-toolbox-0.2.0.tgz",
"integrity": "sha1-p/6lw/3lXmdc8cjAbz67XCk1g14=",
"dev": true
},
"sshpk": {
"version": "1.14.2",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz",

View File

@ -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",