Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Access to Cryptographic API random generator

Project Description
This module gives direct access to Windows Cryptographic

API CryptGetRandom() function. The range() function uses B.5.1.1 Simple Discard Method from NIST SP800-90 with FIPS 140-2 p. 44 Continuous random number generator test.


>>> import winrandom
>>> print winrandom.long()
>>> print repr(winrandom.bytes(10))
<10 random bytes>
>> print winrandom.range(1000)

Changelog: 1.0 added winrandom.long() 1.1 added winrandom.bytes(num) returning num random bytes 1.2 added winrandom.range(max) returning random index n where 0 <= n < max

Release History

Release History

This version
History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
winrandom-1.2.win32-py2.7.exe (202.0 kB) Copy SHA256 Checksum SHA256 2.7 Windows Installer Jan 20, 2012 (3.5 kB) Copy SHA256 Checksum SHA256 Source Jan 20, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting