Skip to content

Instantly share code, notes, and snippets.

@Kurty00
Created August 22, 2022 08:56
Show Gist options
  • Save Kurty00/6173c0811e425269192099bb806b2101 to your computer and use it in GitHub Desktop.
Save Kurty00/6173c0811e425269192099bb806b2101 to your computer and use it in GitHub Desktop.
Node script that finds words you could use in IPv6 addresses.
var fs = require("fs")
var file = fs.readFileSync("words_alpha.txt", { encoding: "utf-8" }).split("\r\n");
var out = [];
var allowedCharacters = ['a', 'b', 'c', 'd', 'e', 'f', 't', 's', 'g', 'i', 'o']
for (let line of file) {
var o = "";
for (var c of line) {
if (allowedCharacters.includes(c.toLowerCase())) {
if (c.match(/[tsgio]/g))
c = c.replace("t", "7").replace("s", "5").replace("g", "6").replace("i", "1").replace("o", "0")
o = o + c;
}
}
if (line.length == o.length) {
//console.log(line)
//console.log(`> ${o}`)
//console.log(line.length, o.length)
out.push(`${line} | ${o}`);
}
}
console.log(out.join("\n"));
@Kurty00
Copy link
Author

Kurty00 commented Aug 22, 2022

If you want to know why I did this, see https://chaos.social/@Kurty00/108859858168556085.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment