parseHexDigit static method

int parseHexDigit(
  1. String chr
)

Implementation

static int parseHexDigit(String chr) {
  final c = chr.codeUnitAt(0);
  if (c >= 48 /*'0'*/ && c <= 57 /*'9'*/) {
    return c - 48;
  }
  if (c >= 97 /*'a'*/ && c <= 102 /*'f'*/) {
    return 10 + (c - 97);
  }
  if (c >= 65 /*'A'*/ && c <= 70 /*'F'*/) {
    return 10 + (c - 65);
  }
  return -1;
}