Anonymous user
Canonicalize CIDR: Difference between revisions
m
Optimise the Common Lisp solution a bit
(Add a Common Lisp solution) |
m (Optimise the Common Lisp solution a bit) |
||
Line 457:
:with start := 0
:for pos := (position #\. ip :start start)
:collect (parse-integer
:while pos
:do (setf start (1+ pos))
Line 473:
(let* ((n (position #\/ cidr))
(ip (subseq cidr 0 n))
(sn (parse-integer
(ip* (ip->bit-vector ip))
(canonical-ip (fill ip* 0 :start sn)))
|