-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 | |||
6 | import hashlib | 6 | import hashlib |
7 | 7 | ||
8 | from functools import reduce | ||
9 | from operator import add | ||
10 | from itertools import izip | ||
11 | |||
8 | import main | 12 | import main |
9 | 13 | ||
@@ -73,8 +77,13 @@ class BackendBuilder(object): | |||
73 | 77 | ||
74 | 78 | ||
79 | def formatMAC (self, value): | ||
80 | x = iter(value) | ||
81 | return ' '.join([reduce(add, tup) for tup in izip(x, x, x, x)]) | ||
82 | |||
83 | |||
75 | def logChecksums (self, content, message): | 84 | def logChecksums (self, content, message): |
76 | md5Digest = hashlib.md5(content.encode('utf-8')).hexdigest() | 85 | md5Digest = self.formatMAC(hashlib.md5(content.encode('utf-8')).hexdigest()) |
77 | shaDigest = hashlib.sha1(content.encode('utf-8')).hexdigest() | 86 | shaDigest = self.formatMAC(hashlib.sha1(content.encode('utf-8')).hexdigest()) |
78 | sha256Digest= hashlib.sha256(content.encode('utf-8')).hexdigest() | 87 | sha256Digest= self.formatMAC(hashlib.sha256(content.encode('utf-8')).hexdigest()) |
79 | print message + ": " + md5Digest + " (md5)" | 88 | print message + ": " + md5Digest + " (md5)" |
80 | print message + ": " + shaDigest + " (sha1)" | 89 | print message + ": " + shaDigest + " (sha1)" |