String toHex(int value) { if (value < 0) { throw ArgumentError.value( value, 'value', 'Must be equal to or greater than 0'); } return '0x${value.toRadixString(16).toUpperCase()}'; }