toHexString method Null safety

String toHexString()

Converts this instance into 24-byte hexadecimal string representation.

Implementation

String toHexString() {
  List<String?> charCodes = List<String?>.filled(24, null);
  int i = 0;
  for (final b in toBytes()) {
    charCodes[i++] = _hexChars[b! >> 4 & 0xF];
    charCodes[i++] = _hexChars[b & 0xF];
  }
  return charCodes.join('');
}