Created
August 22, 2022 08:56
-
-
Save Kurty00/6173c0811e425269192099bb806b2101 to your computer and use it in GitHub Desktop.
Node script that finds words you could use in IPv6 addresses.
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
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")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you want to know why I did this, see https://chaos.social/@Kurty00/108859858168556085.