catalyst: blake2 testing

This commit is contained in:
Rick Farina (Zero_Chaos) 2020-02-11 11:48:56 -05:00
parent c3f05c52ce
commit ed0a6ff53a
No known key found for this signature in database
GPG key ID: A29433C0AA431DDC

View file

@ -1,5 +1,5 @@
diff --git a/catalyst/hash_utils.py b/catalyst/hash_utils.py
index 1134f50..1faa2f5 100644
index 1134f50..8f1ab8f 100644
--- a/catalyst/hash_utils.py
+++ b/catalyst/hash_utils.py
@@ -11,6 +11,7 @@ from catalyst.support import CatalystError
@ -10,7 +10,7 @@ index 1134f50..1faa2f5 100644
"crc32" :["calc_hash2", "shash", ["-a", "CRC32"], "CRC32"],
"crc32b" :["calc_hash2", "shash", ["-a", "CRC32B"], "CRC32B"],
"gost" :["calc_hash2", "shash", ["-a", "GOST"], "GOST"],
@@ -94,12 +95,13 @@ class HashMap(object):
@@ -94,12 +95,14 @@ class HashMap(object):
args = [_hash.cmd]
args.extend(_hash.args)
args.append(file_)
@ -19,12 +19,14 @@ index 1134f50..1faa2f5 100644
- mylines = source.communicate()[0]
- mylines=mylines[0].split()
- result=mylines[0]
+ output = source.communicate()
+ result = output[0].decode('ascii').split('\n')
+ log.debug('output = %s', result)
log.info('%s (%s) = %s', _hash.id, file_, result)
- log.info('%s (%s) = %s', _hash.id, file_, result)
- return result
+ return "# " + _hash.id.upper + "HASH\n" + result
+ output = source.communicate()
+ mylines = output[0].decode('ascii').split('\n')
+ log.debug('output = %s', result)
+ log.info('%s (%s) = %s', _hash.id, file_, mylines)
+ result = "# " + _hash.id + "HASH\n" + mylines
+ return result
def calc_hash2(self, file_, hash_type):