Text description
Constructor of the SUM class doesn't initialize correctly when there is present more than 1 algorithm in the arguments to calculate hashes
Actual behavior
If you create an object with more than one algorithm as an argument and then call calculate()
it won't take into account the first algorithm of the list passed as argument to the constructor
Expected behavior
It should calculate all the algorithms asked
Steps to reproduce the behavior:
Create a Python file and import sum.py
, then create a SUM object and pass a list of all the algorithms without repeating any of them. Finally, call calculate()
to see the result
Fix
Check the constructor line
if len(self.config.algorithms) > 1:
self.config.algorithms = list(set(self.config.algorithms[1:]))
and replace
self.config.algorithms = list(set(self.config.algorithms[1:]))
with
self.config.algorithms = list(set(self.config.algorithms[0:]))