Commit bc97480
committed
fix: ISSN checksum returns 11 instead of 0 when weighted sum is divisible by 11
The `_calculate_checksum` method in `InternationalStandardSerialNumber`
was missing a final `% 11`, causing it to return 11 (an invalid
two-digit value) instead of 0 when the weighted digit sum happened to
be exactly divisible by 11.
Fixes #238.1 parent 1d872d3 commit bc97480Copy full SHA for bc97480
2 files changed
+14-1Lines changed: 14 additions & 1 deletion
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- barcode
- tests
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
113 | 113 | |
114 | 114 | |
115 | 115 | |
116 | | - |
| 116 | + |
117 | 117 | |
118 | 118 | |
119 | 119 | |
|
Collapse file
+13Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
46 | 46 | |
47 | 47 | |
48 | 48 | |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
0 commit comments