site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=UH9gMzZP+1PA4349tqCC6Z1m3GA9VSnrvlIkM7sPgAI=; b=Nh3o56K6oc9tda5InWR4yXatgY1Kj53XVBYPks7Gc0hkk4SDxlP/IcEdowO5yoaNuK bW+Z2N8JmlOUgxB4c2N2T9wZmG8hRYwV1G7d/vMpAJM+S2ShLeypFY+3gFBLVX0lhZjn hbaklfA/XK2WUjL104p+5waE4le/zqJ1YJU6Y= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=Nza21wlnDYEDbF42X+AUb7IYpdpX5XWTFQBHm6aR9nidw2DVNx/e6g73R039IOEPzf AK8sVwsmaRP4XsI8xmGSwq0IqI5F9pBehkYpeJY4DlnMydgI/Wl9XiJbZtk7pW02HsL0 Q7ti0fn+OjKCi52+sgUSk0jU9USj4ae0kLlfI= On Nov 25, 2009, at 11:59 AM, Jay A. Kreibich wrote: This is, I suspect, part of the problem. When random() replaced rand() in the BSD sources ages ago, I'm guessing nobody ever went back and made rand() better. It was understood that you just didn't use rand() and "fixing" it by changing the algorithm would break applications like yours. This is less true in Linux. For one thing, the source code has a much younger lineage, and I'm guessing someone decided it was a good idea to "improve" rand() at some point, even if that meant breaking backwards compatibility. I haven't. Derek _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Have you tried you test on a BSD-based system? Regardless, in that situation I'd write my own PRNG. That way you can exactly control the balance between performance and quality and, more importantly, you'll have cross-platform compatibility. From what you're doing, you don't really need a "random" number, you just need a good hash that will go from regular numbers (row/column) to a good coverage of the number domain. Even something like a CRC might be a good choice... unlike many crypto hashes, it does well with just a few bytes of data to chew on. Thanks for the idea of using a CRC... I hadn't thought about that. A random hash really is what we're going for here... and I'm starting to see that bastardizing rand/srand for that maybe wasn't the best idea ;-) This email sent to site_archiver@lists.apple.com