07-29-2013, 02:25 PM
|
#2
|
|
no
 
Join Date: Jan 2004
Age: 34
Posts: 1,850
|
Re: [Powershell] Calculating Network IPs based on CIDR
bitwise AND by octet instead of by binary digit. each time you bitwise AND an octet, just subtract 8 from how many available bits you have left in your subnet mask. once you get the the point you have less than 8, just calculate what you are ANDing with using 2^(however many bits left). you'll want to test for 0 bits left, of course.
|
|
|