We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 380ee21 + 83770cf commit 1c799bfCopy full SHA for 1c799bf
src/lib/utils/supernet-calculations.ts
@@ -152,7 +152,7 @@ function findSupernet(networks: NetworkInput[]): { network: string; cidr: number
152
153
// Find the smallest CIDR that can contain all networks
154
let supernetCidr = 32;
155
- for (let cidr = 1; cidr <= 30; cidr++) {
+ for (let cidr = 30; cidr >= 1; cidr--) {
156
const mask = 0xffffffff << (32 - cidr);
157
const supernetStart = minAddress & (mask >>> 0);
158
const supernetEnd = supernetStart + Math.pow(2, 32 - cidr) - 1;
0 commit comments