Skip to main content

Java-Random is a simple implementation of Java’s standard java.util.Random class in Python. Java’s random number generation algorithm is exceedingly straightforward to reimplement in other languages, and this is simply an implementation for Python.

Installation

A standard setup.py is provided.

FAQ

Why would you do this?

I needed this particular generator available in another program, and this was the quickest, simplest way to achieve that goal.

What’s wrong with Python’s random module?

Nothing. In fact, Python’s random module is far superior to this module in a number of respects, including predictability, speed, robustness, and features. If you’re looking for good random number generation in Python, just use random instead.

Your code sucks.

That’s not a question. Also, feel free to blame the Java specification for that, as they have a very specific way of doing things and I felt that trying to spice up my code might lead to some unobvious and unfun bugs.

Where is the official Java specification for this, anyway?

http://download.oracle.com/javase/6/docs/api/java/util/Random.html, until Oracle removes it.

…This is for Minecraft, isn’t it?

No comment.

Metadata

Release files for java-random 1.0

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

Source distribution (sdist)

Source distribution for java-random 1.0
File Size Uploaded
java-random-1.0.tar.gz 3.4 kB Details

Release files / java-random-1.0.tar.gz

Download URL java-random-1.0.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
26f5643315a06ea0c04fdc37028e423f4f2bdd59c2525b5c728ebd0d3282bd4c
BLAKE2b-256 checksum
How to use checksums
dfcf4627b9a6c53b3ce03656e4d6c44233968da837812677351facf6a2e28f3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0 This release

1 release file

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