MCPcopy Create free account
hub / github.com/BaseXdb/basex / dec

Method dec

basex-core/src/main/java/org/basex/util/Token.java:1467–1471  ·  view source on GitHub ↗

Converts a hex character to an integer value. @param ch character @return integer value, or -1 if the input is invalid

(final int ch)

Source from the content-addressed store, hash-verified

1465 * @return integer value, or {@code -1} if the input is invalid
1466 */
1467 public static int dec(final int ch) {
1468 if(ch >= '0' && ch <= '9') return ch - '0';
1469 if(ch >= 'a' && ch <= 'f' || ch >= 'A' && ch <= 'F') return (ch & 0x0F) + 9;
1470 return -1;
1471 }
1472
1473 /**
1474 * Converts hex characters to an integer value.

Callers 2

parseMethod · 0.95
decodeUriMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected