We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e3845d5 commit d56c654Copy full SHA for d56c654
index.js
@@ -249,8 +249,12 @@ function integrityStream (opts) {
249
const algorithm = goodSri && sri.pickAlgorithm(opts)
250
const digests = goodSri && sri[algorithm]
251
// Calculating stream
252
- const algorithms = (opts.algorithms || ['sha512'])
253
- .concat(algorithm ? [algorithm] : [])
+ const algorithms = Array.from(
+ new Set(
254
+ (opts.algorithms || ['sha512'])
255
+ .concat(algorithm ? [algorithm] : [])
256
+ )
257
258
const hashes = algorithms.map(crypto.createHash)
259
let streamSize = 0
260
const stream = new Transform({
0 commit comments