Could a truly random number be generated using pings to pseudo-randomly selected IP addresses?

后端 未结 23 2201
天命终不由人
天命终不由人 2021-01-30 16:28

The question posed came about during a 2nd Year Comp Science lecture while discussing the impossibility of generating numbers in a deterministic computational device.

Th

23条回答
  •  无人共我
    2021-01-30 16:50

    It's not as good as using atmospheric noise but it's still truly random since it depends on the characteristics of the network which is notorious for random non-repeatable behavior.

    See Random.org for more on randomness.

    Here's an attempt at an implementation:

    @ips  : list = getIpAddresses();
    @rnd         = PseudorandomNumberGenerator(0 to (ips.count - 1));
    
    @getTrueRandomNumber() { ping(ips[rnd.nextNumber()]).averageTime }
    

提交回复
热议问题