fix(ipv4-range-expander): calculate correct for ip addresses where the first octet is lower than 128 (#405)

This commit is contained in:
cgoIT 2023-05-15 10:23:16 +02:00 committed by GitHub
parent 7aed9c56fd
commit 8c92d56318
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 2 deletions

View file

@ -40,12 +40,12 @@ function calculateCidr({ startIp, endIp }: { startIp: string; endIp: string }) {
value: ipv4ToInt({ ip: startIp }).toString(),
fromBase: 10,
toBase: 2,
});
}).padStart(32, '0');
const end = convertBase({
value: ipv4ToInt({ ip: endIp }).toString(),
fromBase: 10,
toBase: 2,
});
}).padStart(32, '0');
const cidr = getCidr(start, end);
if (cidr != null) {