author | Clipperz <info@clipperz.com> | 2013-01-18 17:17:26 (UTC) |
---|---|---|
committer | Clipperz <info@clipperz.com> | 2013-01-18 17:17:26 (UTC) |
commit | 1e19202f478ca4ab25c6566bf1c17dc7f3698824 (patch) (side-by-side diff) | |
tree | 9b2792add41f98cc8aea44077a40a5064c793610 /scripts/builder/backendBuilder.py | |
parent | 969b9f94a25931a765a4cd4765177979f66c1585 (diff) | |
download | clipperz-1e19202f478ca4ab25c6566bf1c17dc7f3698824.zip clipperz-1e19202f478ca4ab25c6566bf1c17dc7f3698824.tar.gz clipperz-1e19202f478ca4ab25c6566bf1c17dc7f3698824.tar.bz2 |
Improved the reporting of the MAC while building
Diffstat (limited to 'scripts/builder/backendBuilder.py') (more/less context) (show whitespace changes)
-rw-r--r-- | scripts/builder/backendBuilder.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/builder/backendBuilder.py b/scripts/builder/backendBuilder.py index 36b28ca..20b4bd0 100644 --- a/scripts/builder/backendBuilder.py +++ b/scripts/builder/backendBuilder.py @@ -6,4 +6,8 @@ import shutil import hashlib +from functools import reduce +from operator import add +from itertools import izip + import main @@ -73,8 +77,13 @@ class BackendBuilder(object): + def formatMAC (self, value): + x = iter(value) + return ' '.join([reduce(add, tup) for tup in izip(x, x, x, x)]) + + def logChecksums (self, content, message): - md5Digest = hashlib.md5(content.encode('utf-8')).hexdigest() - shaDigest = hashlib.sha1(content.encode('utf-8')).hexdigest() - sha256Digest = hashlib.sha256(content.encode('utf-8')).hexdigest() + md5Digest = self.formatMAC(hashlib.md5(content.encode('utf-8')).hexdigest()) + shaDigest = self.formatMAC(hashlib.sha1(content.encode('utf-8')).hexdigest()) + sha256Digest = self.formatMAC(hashlib.sha256(content.encode('utf-8')).hexdigest()) print message + ": " + md5Digest + " (md5)" print message + ": " + shaDigest + " (sha1)" |