1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-22 05:03:16 +02:00

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