-
Notifications
You must be signed in to change notification settings - Fork 20
Closed
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds an initial reviewneeds an initial review
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
An input containing both sha1+sha512 matches an input with only sha1, but not vice versa:
const ssri = require('ssri')
const sha1 = 'sha1-X1UT+IIv2+UUWvM7ZNjZcNz5XG4='
const sha512 = 'sha512-yzd8ELD1piyANiWnmdnpCL5F52f10UfUdEkHywVZeqTt0ymgrxR63Qz0GB7TKPoeeZQmWCaz7T1+9vBnypkYWg=='
const both = sha1 + ' ' + sha512
// returns truthy
console.log('both,sha1=', ssri.parse(both).match(sha1))
// returns false
console.log('sha1,both=', ssri.parse(sha1).match(both))
Expected Behavior
I would have expected both calls to return a truthy value, since they have an algorithm in common, and the hash matches.
Steps To Reproduce
No response
Environment
- ssri: 9.0.1
- Node: 16.15.1
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds an initial reviewneeds an initial review