<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>lthibau.lt</title><link>https://lthibau.lt/</link><description>Recent content on lthibau.lt</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Fri, 18 Nov 2022 09:09:10 -0500</lastBuildDate><atom:link href="https://lthibau.lt/index.xml" rel="self" type="application/rss+xml"/><item><title>Randomized enumeration of IP addresses in a subnet</title><link>https://lthibau.lt/posts/random-cidr-iter/</link><pubDate>Fri, 18 Nov 2022 09:09:10 -0500</pubDate><guid>https://lthibau.lt/posts/random-cidr-iter/</guid><description>I recently encountered a problem that seemed trivial on the surface, and turned out to be challenging enough to warrant a blog post:
Given a subnet, iterate through its addresses in pseudorandom order.
Naive Approach For small subnets like 10.8.1.0/24, the naive implementation works well. We enumerate each address and append it to a list, shuffle the list, and then range over the list. The first step is the only one I had to stop and think about, but it ended up being quite straightforward.</description></item></channel></rss>