decode method

int decode(
  1. String hex
)

Implementation

int decode(String hex) {
  int value = 0;
  if (hex.isNotEmpty) {
    var array = hex.split('');
    var i = 0;
    for (int count = hex.length - 1; count >= 0; count--) {
      int a = int.tryParse(array[i]) ?? _charDecode(array[i]);
      value += (a * pow(16, count)).round();
      i++;
    }
  }
  return value;
}