subnetToPrefix method
Implementation
int? subnetToPrefix(String? subnet) {
if (subnet == null || subnet == "") {
return null;
}
List<String> chunks = subnet.split(".");
List<String> binary =
chunks.map((String s) => int.parse(s).toRadixString(2)).toList();
String ones = binary.join().replaceAll("0", "");
return ones.length;
}