|
|
Randomness
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
Randomness
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. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.08 seconds |
|