about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/filter_stack.py9
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)