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