Skip to content

Instantly share code, notes, and snippets.

@OrigamiTech
Created February 18, 2011 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OrigamiTech/834380 to your computer and use it in GitHub Desktop.
Save OrigamiTech/834380 to your computer and use it in GitHub Desktop.
using System;
using System.IO;
namespace EveryIPv6
{
class Program
{
static void Main(string[] args)
{
using (StreamWriter sw = new StreamWriter("dump.txt"))
for (ulong u1 = ulong.MinValue; u1 <= ulong.MaxValue; u1++)
for (ulong u2 = ulong.MinValue; u2 <= ulong.MaxValue; u2++)
{
for (byte b = 0; b < 4; b++)
sw.Write(((u1 >> ((3 - b) * 16)) & 0xFFFF).ToString("X4") + ":");
for (byte b = 0; b < 4; b++)
sw.Write(((u2 >> ((3 - b) * 16)) & 0xFFFF).ToString("X4") + (b == 3 ? '\n' : ':'));
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment