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

Method calculate_checksum

barcode/codex.py:68–73  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

66 return self.code
67
68 def calculate_checksum(self):
69 check = sum(code39.MAP[x][0] for x in self.code) % 43
70 for k, v in code39.MAP.items():
71 if check == v[0]:
72 return k
73 return None
74
75 def build(self) -> list[str]:
76 chars = [code39.EDGE]

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected