简体   繁体   English

有没有办法在 Python 或 C++ 中获取绝对或非时间相关的随机数

[英]Is there a way of getting absolute or non time dependent random numbers in Python or C++

I want random numbers so that I can advertise my app as, "Not giving anyone a disadvantage, fundamentally ", I am making game about Quantum Uncertainty which is random, not just pseudo random, so I could do:我想要随机数,以便我可以将我的应用程序宣传为“从根本上不给任何人不利”,我正在制作关于 Quantum Uncertainty 的游戏,它是随机的,而不仅仅是伪随机,所以我可以这样做:

import random
rnd = random.randint(a, b)

But that is pseudo random, not random, it uses the time to generate these numbers, so it's a disadvantage according to time.但那是伪随机,不是随机的,它使用时间来生成这些数字,所以从时间上看是不利的。

I know of secrets module, but that does it through keystrokes, searches, etc, so it will be an advantage for someone who did the right number of key strokes to get a favouring value.我知道秘密模块,但它是通过击键、搜索等来实现的,因此对于执行正确数量的击键以获得有利价值的人来说,这将是一个优势。

I want numbers that are not based on previous events such as keystrokes but real-time random numbers.我想要的数字不是基于以前的事件(例如击键)而是实时随机数。 And by time Independent I don't only mean based on "2:30" but also things like heat over a certain period of time or sound disturbances over a period of time .我所说的时间独立不仅是指基于“2:30”,还包括一段时间内的热量或一段时间内的声音干扰。

Is there any way to achieve that?有没有办法做到这一点?

I know I don't have to worry about these minor details but I don't want to lie when I am advertising but I am making an app about Quantum Uncertainty so I need to be very precise with these stuff.我知道我不必担心这些小细节,但我不想在做广告时撒谎,但我正在制作一个关于 Quantum Uncertainty 的应用程序,所以我需要对这些东西非常精确。 Answer for Python or C++ is okay. Python 或 C++ 的答案是可以的。 This might seem similar to this but isn't.这可能看起来与相似,但并非如此。 I want numbers that don't depend on on anything as not to give anyone disadvantage but the other question wanted to get random numbers which were really secure and random.我想要不依赖于任何东西的数字,以免给任何人带来不利,但另一个问题想要获得真正安全和随机的随机数。 That won't work for me because I want numbers which won't be depending on any kind of data but just produced out of thin air but secure random numbers can be predicted although really hard to because my game is about Quantum Uncertainty I don't just need "Practically True Random" but actual true random.这对我不起作用,因为我想要的数字不依赖于任何类型的数据,而是凭空产生的,但可以预测安全的随机数,虽然真的很难,因为我的游戏是关于量子不确定性的,我不知道t 只需要“实际上是真正的随机”,但实际上是真正的随机。

And I just realized that if there is some crazy website which gives live atom decay information, I can use that.而且我刚刚意识到,如果有一些疯狂的网站可以提供实时原子衰变信息,我可以使用它。

Try using this module https://github.com/lmacken/quantumrandom尝试使用这个模块https://github.com/lmacken/quantumrandom
It gives you tools for interacting with The ANU Quantum Random Number Generator (qrng.anu.edu.au).它为您提供了与 ANU 量子随机数生成器 (qrng.anu.edu.au) 交互的工具。 So it makes your random absolutely random.所以它使你的随机绝对随机。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM