MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / update

Method update

src/commoncode/hash.py:175–188  ·  view source on GitHub ↗

Update this hash with a ``msg`` bytes string.

(self, msg=None)

Source from the content-addressed store, hash-verified

173 self.binh.update(msg=git_blob_header)
174
175 def update(self, msg=None):
176 """
177 Update this hash with a ``msg`` bytes string.
178 """
179 if msg:
180 msg_len = len(msg)
181 if (msg_len + self.msg_len) > self.total_length:
182 raise ValueError(
183 f"Actual combined msg lengths: initial: {self.msg_len} plus added: {msg_len} "
184 f"cannot be larger than the the total_length: {self.total_length}"
185 )
186
187 self.binh.update(msg)
188 self.msg_len += msg_len
189
190
191_hashmodules_by_name = {

Callers 1

__init__Method · 0.95

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected