Skip to content

Commit cafa198

Browse files
committed
Add missing digestsize to hasher wrapper
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent a7b6dff commit cafa198

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/commoncode/hash.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2015 nexB Inc. and others. All rights reserved.
2+
# Copyright (c) 2017 nexB Inc. and others. All rights reserved.
33
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
44
# The ScanCode software is licensed under the Apache License version 2.0.
55
# Data generated with ScanCode require an acknowledgment.
@@ -48,8 +48,8 @@ def _hash_mod(bitsize, hmodule):
4848
"""
4949
class hasher(object):
5050
def __init__(self, msg=None):
51-
digest_size = bitsize // 8
52-
self.h = msg and hmodule(msg).digest()[:digest_size] or None
51+
self.digest_size = bitsize // 8
52+
self.h = msg and hmodule(msg).digest()[:self.digest_size] or None
5353

5454
def digest(self):
5555
return self.h

0 commit comments

Comments
 (0)