Closed nevrome closed 2 years ago
This first issue is fixed. For the future: Implement ORCID checksum checking according to this algorithm
/**
* Generates check digit as per ISO 7064 11,2.
*
*/
public static String generateCheckDigit(String baseDigits) {
int total = 0;
for (int i = 0; i < baseDigits.length(); i++) {
int digit = Character.getNumericValue(baseDigits.charAt(i));
total = (total + digit) * 2;
}
int remainder = total % 11;
int result = (12 - remainder) % 11;
return result == 10 ? "X" : String.valueOf(result);
}
This is now implemented in #11
https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier