MCPcopy Create free account
hub / github.com/WhyNotHugo/python-barcode / _calculate_checksum

Method _calculate_checksum

barcode/codex.py:249–253  ·  view source on GitHub ↗
(self, encoded: list[int])

Source from the content-addressed store, hash-verified

247 return encoded
248
249 def _calculate_checksum(self, encoded: list[int]) -> int:
250 cs = [encoded[0]]
251 for i, code_num in enumerate(encoded[1:], start=1):
252 cs.append(i * code_num)
253 return sum(cs) % 103
254
255 def _build(self) -> list[int]:
256 encoded: list[int] = [code128.START_CODES[self._charset]]

Callers 1

buildMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected