check digit calculation

check digit calculation