You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
consterr=newError(`stream size mismatch when checking ${this.sri}.\n Wanted: ${this.opts.size}\n Found: ${this.size}`)
64
+
err.code='EBADSIZE'
65
+
err.found=this.size
66
+
err.expected=this.opts.size
67
+
err.sri=this.sri
68
+
this.emit('error',err)
69
+
}elseif(this.opts.integrity&&!match){
70
+
consterr=newError(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${newSri}. (${this.size} bytes)`)
71
+
err.code='EINTEGRITY'
72
+
err.found=newSri
73
+
err.expected=this.digests
74
+
err.algorithm=this.algorithm
75
+
err.sri=this.sri
76
+
this.emit('error',err)
77
+
}else{
78
+
this.emit('size',this.size)
79
+
this.emit('integrity',newSri)
80
+
match&&this.emit('verified',match)
81
+
}
82
+
}
38
83
}
39
84
40
85
classHash{
@@ -303,53 +348,7 @@ function checkStream (stream, sri, opts) {
0 commit comments