commit: d598fc248691c31452a6cafdc3df256695bc3aed
parent 97b3c5bd2e165988bc0f042f9e1d7bbf077b0320
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sun, 19 Oct 2025 18:34:45 +0200
cidr2list.1: 0.0.0.0/0 takes ~17mins and 57.125 GiB
Diffstat:
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/cidr2list.1 b/cidr2list.1
@@ -31,9 +31,13 @@ large ranges like /48 and /64 which would respectively imply
printing 2^(128-48) and 2^(128-64) IPv6 addresses.
Which cannot fit into current (2025) storage, let alone RAM.
.Pp
-Meanwhile even printing 0.0.0.0/0 (all of IPv4) would take less than
-(2^32)*16\ =\ 64\ GiB, which is big but not impractical.
-.br
-16 being the maximum used for each line: 4*3 digits, 3 dots, 1 newline.
+Meanwhile listing out 0.0.0.0/0 (all of IPv4),
+is exactly 2^32\ *\ 4\ =\ 16\ GiB if kept in binary representation,
+and less than 2^32\ *\ (3*4\ +\ 3\ +\ 1)\ =\ 64\ GiB in textual representation.
+.Pp
+Testing it out, it takes 61\ 337\ 501\ 696\ bytes\ (~57.125\ GiB), and about
+17\ minutes with
+.Nm
+going at ~54.8MiB/s.
.Sh AUTHORS
.An Haelwenn (lanodan) Monnier Aq Mt contact@hacktivis.me