diff --git a/reputation/db/mongo.py b/reputation/db/mongo.py index 5180942..1ae6754 100644 --- a/reputation/db/mongo.py +++ b/reputation/db/mongo.py @@ -200,7 +200,7 @@ def _build_file_document(input_dict): :return: A dictionary ready to be pushed into the file collection """ current_ts = int(time.time() * 100) - raw_hash = hashlib.sha256(input_dict['raw']).hexdigest() + raw_hash = hashlib.sha256(input_dict['raw'].encode()).hexdigest() rnd_val = random.randint(10000, 99999) filename = '{}-{}-{}'.format(current_ts, raw_hash, rnd_val)