Update this hash with a ``msg`` bytes string.
(self, msg=None)
| 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 = { |