From a26776322c51176f144aca1ca3adb2bf738d1805 Mon Sep 17 00:00:00 2001 From: HugoDelval Date: Wed, 25 Oct 2017 15:31:45 +0200 Subject: [PATCH] fix(mongo): encoding --- reputation/db/mongo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)