diff --git a/barcode/ean.py b/barcode/ean.py index c89408f..dafe929 100755 --- a/barcode/ean.py +++ b/barcode/ean.py @@ -90,9 +90,9 @@ def calculate_checksum(self): def sum_(x, y): return int(x) + int(y) - evensum = reduce(sum_, self.ean[-2::-2]) - oddsum = reduce(sum_, self.ean[-1::-2]) - return (10 - ((evensum + oddsum * 3) % 10)) % 10 + evensum = reduce(sum_, self.ean[1:12:2]) + oddsum = reduce(sum_, self.ean[0:11:2]) + return (10 - ((oddsum + evensum * 3) % 10)) % 10 def build(self): """Builds the barcode pattern from `self.ean`.