Module:IP/doc: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
fix two glitches: subnets 1.2.3.0/24 and 1.2.0.0/16 are not equal (can't think of a better replacement); subnet 1.2.4.0/16 is invalid
(document Subnet methods)
(fix two glitches: subnets 1.2.3.0/24 and 1.2.0.0/16 are not equal (can't think of a better replacement); subnet 1.2.4.0/16 is invalid)
Line 198:
Subnet.new('1.2.3.0/24') == Subnet.new('1.2.3.0/24') -- true
Subnet.new('1.2.3.0/24') == Subnet.new('1.2.3.0/25') -- false
Subnet.new('1.2.3.0/24') == Subnet.new('1.2.0.2001:db8::ff00:12:0/16112') -- truefalse
Subnet.new('2001:db8::ff00:12:0/112') == Subnet.new('2001:db8::ff00:12:0/112') -- true
Subnet.new('2001:db8:0:0:0:0:0:0/112') == Subnet.new('2001:db8::/112') -- true
Line 353:
<source lang="lua">
Subnet.new('1.2.3.0/24'):overlapsSubnet('1.2.0.0/16') -- true
Subnet.new('1.2.3.0/24'):overlapsSubnet('1.2.412.0/1622') -- false
Subnet.new('1.2.3.0/24'):overlapsSubnet(Subnet.new('1.2.0.0/16')) -- true
Subnet.new('2001:db8::ff00:12:0/112'):overlapsSubnet('2001:db8::ff00:0:0/96') -- true
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu