Created
February 18, 2011 20:50
-
-
Save OrigamiTech/834380 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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