An example of how to write an LCG in golang.
Go to file
2024-01-14 17:48:59 -06:00
main.go first 2024-01-14 17:48:59 -06:00
README.md first 2024-01-14 17:48:59 -06:00

<@acidvegas> darkmage: how easily do you think you could
<@acidvegas> isolate masscans
<@acidvegas> range function
<@acidvegas> into golang or python
<@acidvegas> aka
<@acidvegas> generating ip addresses
<@acidvegas> randomly
<@acidvegas> for massive ranges like 0.0.0.0/0
<@acidvegas> in a memory safe manner

Really easily, it turns out.

You can generate numbers in a predictable manner by feeding a custom seed to an RNG to find a random starting position, modifying it with an offset relative to which shard (assuming you're using multiple shards but not required) is generating addresses (so that no two shards generate the same address