Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

wp_rand() for Entropy PHP

The Entropy builds of PHP can truncate ints instead of overflowing as floats. That misbehavior breaks wp_rand(), wp_generate_password(), and Jetpack.

On some 32bit hosts, the Entropy builds of PHP truncate integers larger than PHP_INT_MAX to PHP_INT_MAX rather than overflowing them as floats.

This can cause wp_rand() to return a value outside the requested range. That unexpected value in turn breaks wp_generate_password(), which can have security ramifications.

Of particular note to this plugin's authors, the bug prevents Jetpack from functioning.

This plugin works around the bug by redefining the pluggable wp_rand() function. In the redefinition, large integers are expressed as strings and cast to floats, rather than as ints.

Requires: 3.0 or higher
Compatible up to: 3.3.2
Last Updated: 2011-12-15
Downloads: 385


5 stars
5 out of 5 stars


Got something to say? Need help?


Not enough data

0 people say it works.
0 people say it's broken.