gpt4 book ai didi

python - 哪些平台提供 SystemRandom?

转载 作者:太空狗 更新时间:2023-10-30 03:07:06 25 4
gpt4 key购买 nike

Python 的 random.SystemRandom 提供加密质量的伪随机数。它支持哪些平台?最重要的是,有没有不支持它的平台,如果有,是哪些平台?任何人都可以提供有关它的便携性的任何信息吗?

最佳答案

来自 http://docs.python.org/library/random.html

The random module also provides the SystemRandom class which uses the system function os.urandom() to generate random numbers from sources provided by the operating system.

来自 http://docs.python.org/library/os.html#os.urandom

This function returns random bytes from an OS-specific randomness source. The returned data should be unpredictable enough for cryptographic applications, though its exact quality depends on the OS implementation. On a UNIX-like system this will query /dev/urandom, and on Windows it will use CryptGenRandom. If a randomness source is not found, NotImplementedError will be raised.

关于python - 哪些平台提供 SystemRandom?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6219254/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com