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.
1 parent ce5d026 commit 20a4998Copy full SHA for 20a4998
barcode/codex.py
@@ -59,12 +59,14 @@ def get_fullcode(self) -> str:
59
""":returns: The full code as it will be encoded."""
60
return self.code
61
62
- def calculate_checksum(self):
+ def calculate_checksum(self) -> str:
63
check = sum(code39.MAP[x][0] for x in self.code) % 43
64
for k, v in code39.MAP.items():
65
if check == v[0]:
66
return k
67
- return None
+ raise RuntimeError(
68
+ "All possible values for the checksum should have been included in the map."
69
+ )
70
71
def build(self):
72
chars = [code39.EDGE]
0 commit comments