def calc_check_digit(number): """Calculate the check digit. The number passed should not have the check digit included.""" return str((6 - luhn.checksum(number[1:])) % 10)
from stdnum import luhn i = 0 while True: i += 1 c =luhn.checksum(str(i)) print str(i) + str(c) #print hex(int(str_))
def check_digit(chunk): return alphabet[-luhn.checksum(chunk, alphabet=alphabet)]
def invoice_no(self): return luhn.checksum()