Skip to main content

python-fastrand

A pure python clone of lemire/fastrand

Installation

With pip:

pip install python-fastrand

From source:

git clone https://github.com/mukundan314/python-fastrand.git
cd python-fastrand
python setup.py install

Usage

All methods are compatible with the ones in lemire/fastrand provided in the pyfastrand module

>>> import pyfastrand
>>> pyfastrand.pcg32bounded(1000)
498
>>> pyfastrand.pcg32()
1547545700

Benchmarks

$ bash benchmark.sh
_random.Random().random
2000000 loops, best of 5: 156 nsec per loop

fastrand.pcg32
2000000 loops, best of 5: 137 nsec per loop

fastrand.pcg32bounded
5000000 loops, best of 5: 78.2 nsec per loop

os.urandom
500000 loops, best of 5: 865 nsec per loop

pyfastrand.pcg32
500000 loops, best of 5: 634 nsec per loop

pyfastrand.pcg32bounded
500000 loops, best of 5: 749 nsec per loop

random.randint
500000 loops, best of 5: 822 nsec per loop

random.random
2000000 loops, best of 5: 169 nsec per loop

Metadata

Release files for python-fastrand 1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for python-fastrand 1.1
File Interpreter ABI Platform Actions
python_fastrand-1.1-py2.py3-none-any.whl Python 2, Python 3 none any Details for python_fastrand-1.1-py2.py3-none-any.whl

Release files / python_fastrand-1.1-py2.py3-none-any.whl

Download URL python_fastrand-1.1-py2.py3-none-any.whl
Size 3.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
3e8fe2eb8dc386a6cd881068ef89e3de711559492e2c2a960aa8f2128d3a1f06
BLAKE2b-256 checksum
How to use checksums
1f08f8fe0ff100da459430ad9f50831e71fdcae5e8fc46f550bccc563cdadd29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Security for python-fastrand 1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page