Skip to content

Commit

Permalink
Switch to SOWPODS dictionary and use gzip compression
Browse files Browse the repository at this point in the history
  • Loading branch information
Jcparkyn committed Nov 5, 2023
1 parent 8f96800 commit 82baa90
Show file tree
Hide file tree
Showing 3 changed files with 89,074 additions and 2 deletions.
14 changes: 13 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,20 @@
}, { capture: true});
}
});

const fetchWordlist = async () => {
if ("DecompressionStream" in window) {
const ds = new DecompressionStream('gzip');
const wordlistBlob = await fetch('sowpods.txt.gz').then(res => res.blob());
const decompressedStream = wordlistBlob.stream().pipeThrough(ds);
return await new Response(decompressedStream).text();
}
return await fetch('sowpods.txt').then(res => res.text());
}

const start = async () => {
const wordlist = await fetch('dictionary.txt').then(res => res.text());
const wordlist = await fetchWordlist();

// This seed isn't perfect, but it doesn't matter too much
const initialSeed = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);
const shareUrlSupported = !!(navigator.canShare && navigator.canShare({ url: window.location.href }));
Expand Down
Loading

0 comments on commit 82baa90

Please sign in to comment.