473,327 Members | 2,094 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

True random device and PHP

Does anyone know how one can get values from the on-chip random device on
modern Intel processors using PHP ? I am using a windows (XP) based system,
PHP 4.3.8

TIA
Pjotr
Jul 17 '05 #1
4 2237
On Sat, 2 Oct 2004 14:17:29 +0200, "Pjotr Wedersteers" <x3****@westerterp.com>
wrote:
Does anyone know how one can get values from the on-chip random device on
modern Intel processors using PHP ? I am using a windows (XP) based system,
PHP 4.3.8


The information on this page:

http://home.comcast.net/~andrex/hardware-RNG/index.html

... came as a bit of a surprise. Looks like Intel have stopped putting
hardware RNGs in their chips.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2
This is what i am using currently (i always check the DB for dupes first) --

$random = md5 (uniqid (rand()));

I have never had a duplicate alpha-numeric random yet and i am up to 500,000
Phil

Andy Hassall <an**@andyh.co.uk> wrote in message news:<ar********************************@4ax.com>. ..
On Sat, 2 Oct 2004 14:17:29 +0200, "Pjotr Wedersteers" <x3****@westerterp.com>
wrote:
Does anyone know how one can get values from the on-chip random device on
modern Intel processors using PHP ? I am using a windows (XP) based system,
PHP 4.3.8


The information on this page:

http://home.comcast.net/~andrex/hardware-RNG/index.html

... came as a bit of a surprise. Looks like Intel have stopped putting
hardware RNGs in their chips.

Jul 17 '05 #3
Andy Hassall wrote:
On Sat, 2 Oct 2004 14:17:29 +0200, "Pjotr Wedersteers"
<x3****@westerterp.com> wrote:
Does anyone know how one can get values from the on-chip random
device on modern Intel processors using PHP ? I am using a windows
(XP) based system, PHP 4.3.8


The information on this page:

http://home.comcast.net/~andrex/hardware-RNG/index.html

... came as a bit of a surprise. Looks like Intel have stopped putting
hardware RNGs in their chips.


I already feared the RNG at least was not going to be widespread. This news
simply deflates any hopes I might have had of using it in my programs.
Thanks for this link Andy.

Pjotr
Jul 17 '05 #4
Phil Palmieri wrote:
This is what i am using currently (i always check the DB for dupes
first) --

$random = md5 (uniqid (rand()));

I have never had a duplicate alpha-numeric random yet and i am up to
500,000

This method is far from random, even when you haven't got one single
duplicate yet.
uniqid () is based on microtime (i.e. predictable) and rand () does not
exceed the range of an integer.
Also rand() which stems from the original libc branch is considered slow and
not very random indeed.

If you need something more random u might check out the mt_rand() function
(mt stands for Mersenne Twister, after the algorithm used for producing
random values).

For good randomness in cardgames sims I need either a true random source or
a pRNG with a range way higher than rand(). Most cardgame sites use advanced
PRNG's mixed with random info such as user mouse movement data, timeout
values et cetera.

Of course all this is not required for simple usage, but for some uses (such
as commercial pokerware) it simply won't do. Thanks for your input too Phil!

Regds
Pjotr
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Nicholas Geraldi | last post by:
Im looking for a decent random number generator. Im looking to make a large number of random numbers (100 or so, if not more) in a short period of time (as fast as possible). the function i was...
21
by: Ron Peterson | last post by:
In the following piece of code, which simply generates a sequence of (random) octal codes, I'm surprised by the apparent non-randomness of /dev/random. It's not noticeable unless RAND_LENGTH is...
10
by: Curt_C [MVP] | last post by:
If I use it in my page it's fine but when I put it in a Class file for calling it returns the same # for each call. Any ideas why? I'm sure it's something I'll slap myself for but the only samples...
9
by: abhi | last post by:
How do you get random numbers in vb .net? I want random six digit numbers. Cheers, Abhi
1
by: Luis Ramos | last post by:
Happy new year for everybody... My problem is this: I can open a random file with vs2005 this way(normal project), but not in a smart device project. example: Structure Record public ID As...
11
by: TreatmentPlant | last post by:
I need to generate a few thousand true random numbers using C++. I have some code now that does alright, but when you plot the results on a graph, you notice patterns, so the numbers are not...
13
by: porterboy76 | last post by:
If you only use a 32 bit seed for a random number generator, does that mean you can only ever produce a maximum of 2^32 (approx 4 billion) different sequences? What about the Mersenne Twister,...
16
by: Claudio Grondi | last post by:
I have a 250 Gbyte file (occupies the whole hard drive space) and want to change only eight bytes in this file at a given offset of appr. 200 Gbyte (all other data in that file should remain...
21
by: chico_yallin | last post by:
I just wana make a random id number based on4 digits-for examples?? Thanks in Advance Ch.Yallin
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.