Alternative Entropy Sources

前端 未结 15 758
情书的邮戳
情书的邮戳 2020-12-11 02:12

Okay, I guess this is entirely subjective and whatnot, but I was thinking about entropy sources for random number generators. It goes that most generators are seeded with th

15条回答
  •  自闭症患者
    2020-12-11 02:14

    Source of seed isn't that much important. More important is the pseudo numbers generator algorithm. However I've heard some time ago about generating seed for some bank operations. They took many factors together:

    • time
    • processor temperature
    • fan speed
    • cpu voltage
    • I don't remember more :)

    Even if some of these parameters doesn't change much in time, you can put them into some good hashing function.

    How to generate good random number?

    Maybe we can take into account inifinite number of universes? If this is true, that all the time new parallel universes are being created, we can do something like this:

    int Random() {
        return Universe.object_id % MAX_INT;
    }
    

    In every moment we should be on another branch of parallel universes, so we should have different id. The only problem is how to get Universe object :)

提交回复
热议问题