Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Randomness' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Randomness
Authored by: jimr on Aug 30, '01 01:07:23PM
From my *limited* understanding
apparently we do not have a true dev/random on the MacOSX.
on othe systems this is replaced by a set of libraries which are called EGD
?"Entropy Generation Device"?

These sorts of things are necessary and useful for all sorts of applications and especially might be
useful for Encryption or other theoretical mathematics.

your need for functions like rand48()
seem to indicate a 48 bit returned value from the function.

With some rather messy details it might be possible to replicate the functionality and the name space of such a function.

MacOSX does have random() which I am assuming returns a 32 bit random value.

The nature of randomness on computers is that most random functions are only random in that
they return a completely different number each time they are run. However, the sequence of
random numbers might need to be, itself, randomized by adding a new seed value each time you
run the function.


I have read of some interesting approaches for both generation of seeds and generation of
"natural"
sequences of "randomness". for example going into the swap space and copying
from some block. This would be either any block or again some generated address which
would then return some part of the ever changing data in the swap partition. which would never be
the same unless the machine is off. and then convert that data to a numerical string and feed it
to the random generation function.

whether you build a library to handle all of this, or just make a header file to make your application
happy. or first, I would try to change the references in the source to drand48() to random()
and see if it works well enough.


I haven't checked all of my information, nor do I know what you are trying to accomplish exactly.

Otherwise, building a library... just like an application . Declartion files; header files and the
correct output commands in the compiler. Basically, an application revolves around a call to
main().
And I forget.. A library source file needs a call to libmain() or maindll()[in windows].

Feel free to punch this post full of holes as it is an interesting discussion.

Jim







[ Reply to This | # ]
Randomness
Authored by: Anonymous on Aug 31, '01 03:12:45AM

I'm guessing dev/random will be in 10.1, since last I heard on darwin-dev that Louis Gerbarg had a working version of it some time ago.

Don't take my word for it, though ;-)



[ Reply to This | # ]