diff options
author | arkedos <arkedos@mailbox.org> | 2019-12-08 21:55:39 +0100 |
---|---|---|
committer | toonn <toonn@toonn.io> | 2019-12-23 16:36:50 +0100 |
commit | ce0753b6a7eedb4ef616e9d9433bd73a0a617226 (patch) | |
tree | 341131ed0e62de51f380d42eb711f609d2c16ba8 | |
parent | 73b98e7d74411a525d82051929ef72dce0e03c1e (diff) | |
download | ranger-ce0753b6a7eedb4ef616e9d9433bd73a0a617226.tar.gz |
Replacing md5 with blake2b
-rw-r--r-- | ranger/core/filter_stack.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ranger/core/filter_stack.py b/ranger/core/filter_stack.py index 4c00e09b..0e0d4807 100644 --- a/ranger/core/filter_stack.py +++ b/ranger/core/filter_stack.py @@ -91,8 +91,13 @@ class HashFilter(BaseFilter): return "<Filter: hash {}>".format(self.args) def get_hash(self, file_basename): - import hashlib - self.hasher = hashlib.md5() + import sys + if sys.version_info.major < 3: + from hashlib import md5 + self.hasher = md5() + elif sys.version_info.major == 3: + import hashlib + self.hasher = hashlib.blake2b() data = open(file_basename, 'rb') buff = data.read() self.hasher.update(buff) |