We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c0330a1 + 7a5359c commit 5210b90Copy full SHA for 5210b90
adafruit_hashlib/_sha1.py
@@ -128,9 +128,10 @@ class sha1():
128
digest_size = SHA_DIGESTSIZE
129
block_size = SHA_BLOCKSIZE
130
name = "sha1"
131
- def __init__(self):
+ def __init__(self, data=None):
132
"""Construct a SHA-1 hash object.
133
- :param bytes data: data to process
+ :param bytes data: Optional data to process
134
+
135
"""
136
# Initial Digest Variables
137
self._h = (0x67452301,
@@ -146,6 +147,9 @@ def __init__(self):
146
147
# Length in bytes of all data that has been processed so far
148
self._msg_byte_len = 0
149
150
+ if data:
151
+ self.update(data)
152
153
def _create_digest(self):
154
"""Returns finalized digest variables for the data processed so far.
155
0 commit comments