An example of how to write an LCG in golang.
main.go | ||
README.md |
<@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