internal static char GetChecksum(string text) {
int chk = 0;
for (int k = 0; k < text.Length; ++k) {
int idx = CHARS.IndexOf(text[k]);
if (idx < 0)
throw new ArgumentException("The character '" + text[k] + "' is illegal in code 39.");
chk += idx;
}
return CHARS[chk % 43];
}