private static final byte checkedToByteFromPrintableAscii(char c)
      throws GeneralSecurityException {
    if (c < '!' || c > '~') {
      throw new GeneralSecurityException("Not a printable ASCII character: " + c);
    }
    return (byte) c;
  }
Returns a positive random int which can be used as a key ID in a keyset.
java_src/src/main/java/com/google/crypto/tink/internal/Util.java