IP lister...
-
I made a simple prog in console that listed ALL the ip's that are possible... don't ask, and I stumbled onto a problem, I was storing those ip's into a txt file, but when the ip's were only on 1.0.0.0 the txt file was aproximatly 200mb, you know .2gb, anyways does anyone know how to make that file smaller or is that the smallest I can get? Actual Linux Penguins were harmed in the creation of this message.
-
I made a simple prog in console that listed ALL the ip's that are possible... don't ask, and I stumbled onto a problem, I was storing those ip's into a txt file, but when the ip's were only on 1.0.0.0 the txt file was aproximatly 200mb, you know .2gb, anyways does anyone know how to make that file smaller or is that the smallest I can get? Actual Linux Penguins were harmed in the creation of this message.
There are a few ways I can think of, but it's hard without more information. 1. Don't store it as text, save them as binary groups of four bytes 2. Only store the changes between each digit (0.0.0.[x0, x1, .. x254, x255], 0.0.1.[x0, x1, .. x254, x255], ...) 3. Don't save them at all, just generate them on the fly, this would be ideal but it depends on your situation.
If you can keep you head when all about you Are losing theirs and blaming it on you; If you can dream - and not make dreams your master; If you can think - and not make thoughts you aim; Yours is the Earth and everything that's in it. Rudyard Kipling
-
I made a simple prog in console that listed ALL the ip's that are possible... don't ask, and I stumbled onto a problem, I was storing those ip's into a txt file, but when the ip's were only on 1.0.0.0 the txt file was aproximatly 200mb, you know .2gb, anyways does anyone know how to make that file smaller or is that the smallest I can get? Actual Linux Penguins were harmed in the creation of this message.
Snyp wrote: ALL the ip's that are possible... I second Andrew's suggestion: there's no need to store these on disk - simply generate them on the fly. /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com
-
Snyp wrote: ALL the ip's that are possible... I second Andrew's suggestion: there's no need to store these on disk - simply generate them on the fly. /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com
-
I just wanted to do this for fun, to see what and how large it would be, I have a 30 gig hard drive and I calculated the document to come out aproximatly 50 gigs!!!!:-D Actual Linux Penguins were harmed in the creation of this message.
You know there are 4 billion of them, generating them is like counting from 0-0xffffffff. Uncompressed binary storage would require 16GB. But making a computer count from 0-4 billion seems rather pointless. Paul
-
I made a simple prog in console that listed ALL the ip's that are possible... don't ask, and I stumbled onto a problem, I was storing those ip's into a txt file, but when the ip's were only on 1.0.0.0 the txt file was aproximatly 200mb, you know .2gb, anyways does anyone know how to make that file smaller or is that the smallest I can get? Actual Linux Penguins were harmed in the creation of this message.
Unless you actually needed them for something, there are 232 possible addresses, but not all of those are valid. Assuming each address is 15 bytes, you could store 13,981,013 within a 200MB file. However, since an IP address is also a 32-bit value, you could store it as a 32-bit value instead. Now that 200MB file can store 52,428,800 addresses.
for (unsigned int x = 0; x < UINT_MAX; x++)
fwrite(&x, sizeof(x), 1, ...);
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
-
You know there are 4 billion of them, generating them is like counting from 0-0xffffffff. Uncompressed binary storage would require 16GB. But making a computer count from 0-4 billion seems rather pointless. Paul
Paul Ranson wrote: But making a computer count from 0-4 billion seems rather pointless. That reminds me of the time I had two computers: a Commodore 64 (which had a clock speed of 1.02 MHz), and a 12 MHz AT-Compatible PC. I used to code up identical (sorting) programs in basic and watch them run. Yes it was pointless, and I never understood why the C64 never won at least a few times! It just didn't seem fair.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)