code: static char getChecksum(String text) {
          int chk = 0;
          for (int k = 0; k < text.length(); ++k) {
              int idx = CHARS.indexOf(text.charAt(k));
              if (idx < 0)
                  throw new IllegalArgumentException("The character '" + text.charAt(k) + "' is illegal in code 39.");
              chk += idx;
          }
          return CHARS.charAt(chk % 43);
      }
docs: Calculates the checksum.
  @param text the text
  @return the checksum