diff options
author | XhmikosR <xhmikosr@gmail.com> | 2018-10-13 16:40:38 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2018-10-14 07:41:45 +0300 |
commit | 3fcddfa42e61ee7e6fe44aa2412ea7929ec799d0 (patch) | |
tree | 1b8c597ca3ed14b842bc04fdad1c9a69a08cd6ac /build | |
parent | b2b933c1819aeb607eb08ade11fe63fb715b4c00 (diff) |
Remove sri-toolbox dependency.
We can achieve the same very easily.
Diffstat (limited to 'build')
-rw-r--r-- | build/generate-sri.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/build/generate-sri.js b/build/generate-sri.js index 4d5c25c44e..8d0fedc4ab 100644 --- a/build/generate-sri.js +++ b/build/generate-sri.js @@ -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}`) |