toBinaryString method
Returns the binary representation of the bits.
If padTo is provided, pads with leading zeros to that length.
Implementation
String toBinaryString({int? padTo}) {
final binary = _converter.bits.toRadixString(2);
if (padTo != null && binary.length < padTo) {
return binary.padLeft(padTo, '0');
}
return binary;
}