When you generate an IP, add it to an array and compare each time you generate a new one in order to throw out copies.
This will become very inefficient though if you are generating large numbers of these things.
I already do that (see Screenshot)
I did a Benchmark to proof you wrong. I ran a test with a simple project to measure the time it takes to generate a new IP with over 200,000 IPs in a array. Btw. Browsers are effected by vsync (NWjs too) ...
... So after 200,000 generated IPs in the array, it takes 0.0083s on my 120hz Monitor to generate a new IP, that is unique. But ... the normal delta-time for a 120hz monitor is all so 0.0083s per tick.
On my Intel i5 4570 with 3.20ghz, NWjs has a CPU usage of ~0.9% after generating over 200,000 IPs ... so no real performance impact.
Btw. an 1dArray with exactly 200,000 IPs would have a physical size of 4.2mb ...
EDIT:
And this will run server side, so no client performance impact.