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