node-netmask icon indicating copy to clipboard operation
node-netmask copied to clipboard

Different results with old a new version

Open rols2015 opened this issue 1 year ago • 0 comments

Hello, I upgraded from v1.0.6 to 2.00 and I got different results:

const localCIDR = new Netmask('10.10');
console.log(localCIDR);

With 2.0.0 output is

Netmask {
  bitmask: 32,
  maskLong: 4294967295,
  netLong: 167772170,
  size: 1,
  base: '10.0.0.10',
  mask: '255.255.255.255',
  hostmask: '0.0.0.0',
  first: '10.0.0.10',
  last: '10.0.0.10',
  broadcast: undefined
}

but with 1.0.6 I had

Netmask {
   bitmask: 16,
     maskLong: 4294901760,
     netLong: 168427520,
     size: 65536,
     base: '10.10.0.0',
     mask: '255.255.0.0',
     hostmask: '0.0.255.255',
     first: '10.10.0.1',
     last: '10.10.255.254',
     broadcast: '10.10.255.255'
 }

I get the same result only if I provide the full adresse

const localCIDR = new Netmask('10.10.0.0/16');

rols2015 avatar May 15 '24 18:05 rols2015