Canonicalize CIDR: Difference between revisions

Content added Content deleted
m (Optimise the Common Lisp solution a bit)
m (Add the missing argument to a function in the CL solution)
Line 476: Line 476:
(ip* (ip->bit-vector ip))
(ip* (ip->bit-vector ip))
(canonical-ip (fill ip* 0 :start sn)))
(canonical-ip (fill ip* 0 :start sn)))
(bit-vector->ip canonical-ip)))
(bit-vector->ip canonical-ip sn)))


(loop :for cidr :in '("36.18.154.103/12" "62.62.197.11/29"
(loop :for cidr :in '("36.18.154.103/12" "62.62.197.11/29"