Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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