我想在 Windows 上使用英特尔的 RDRAND 功能并生成真正的随机数(因为 Python 的随机模块不是那么随机)。Python中是否有任何API可以访问此功能?
我已经尝试安装下面评论中提到的 rdrand 模块,但我一直收到错误消息。日志: http: //pastebin.com/A2Vqsqec
rdrand.c 中的这些行似乎引发了错误:
#ifdef __GNUC__
#define USING_GCC 1
#elif __clang__
#define USING_CLANG 1
#else
#error Only support for gcc or clang currently
#error if you port to another compiler, please
#error send back the patch to https://github.com/stillson/rdrand
#endif
为什么会这样?
更新:我已经检查并确保定义了 __GNUC__