php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #32145 Mersenne Twister seed option required
Submitted: 2005-03-01 10:25 UTC Modified: 2022-04-08 08:24 UTC
Votes:3
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: hardeman at nmni dot net Assigned: ilutov (profile)
Status: Closed Package: Math related
PHP Version: All versions OS: All OS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: hardeman at nmni dot net
New email:
PHP Version: OS:

 

 [2005-03-01 10:25 UTC] hardeman at nmni dot net
Description:
------------
Unless the PHP documentation is not up-to-date, the only seed option for the Mersenne Twister RNG is a 32-bit integer. The original (updated) MT implementation (see http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html), however, allows for seed arrays of arbitrary length to better exploit the large period of the RNG. It would be nice if this option were built in in future versions of PHP so that I myself and probably quite a few other PHP users won't have to implement the RNG in PHP code itself or create a private extension in C++. Adding this feature to PHP should not require a lot of effort as other implementations are readily available.


Patches

1e8bPhq.out (last revision 2013-12-12 18:40 UTC by bebymiss at yahoo dot co dot uk)

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-04 15:33 UTC] hardeman at nmni dot net
As a temporary solution, I have now created a PHP class which implements the Mersenne Twister PRNG with the updated initialization methods. I can make this class available to other PHP users - just send me a mail.

Hendrik Hardeman
 [2016-12-30 22:48 UTC] cmb@php.net
-Package: Feature/Change Request +Package: Math related
 [2022-04-08 08:22 UTC] ilutov@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: ilutov
 [2022-04-08 08:22 UTC] ilutov@php.net
There are ongoing discussions about a random extensions. The last (failed) RFC attempt is here. https://wiki.php.net/rfc/rng_extension Thus, I'm closing this issue.
 [2022-04-08 08:24 UTC] ilutov@php.net
Correction: It's under discussion, not failed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 11:01:30 2024 UTC