Efficient calculation of an ISBN-13 check digit