代码之家  ›  专栏  ›  技术社区  ›  Ian G

Windows等效于/dev/random[关闭]

  •  37
  • Ian G  · 技术社区  · 18 年前

    有没有与Linux相当的Windows /dev/random ?

    3 回复  |  直到 8 年前
        1
  •  17
  •   laggingreflex    11 年前

    是的,它叫 Microsoft CryptoAPI

        2
  •  1
  •   cxxl    12 年前

    StingyJack答案中的链接很好: http://en.wikipedia.org/wiki/CryptGenRandom

    微软C++ Visual Studio自2005提供 rand_s() RtlGenRandom (与CryptoAPI的PRNG函数一样),其内部工作不会公开。似乎在XP中有一些缺陷已经被修复。

    就我个人而言,我使用 rand_s() 作为随机性的另一个来源,我选择了一个PRNG。

        3
  •  0
  •   tvanfosson    18 年前

    如果您正在进行.NET开发,可以使用 RandomNumberGenerator

    推荐文章