Admittedly, I don't know much about this from the haskell end or about the particular api.<div><br></div><div>If you want statistical randomness, your seed doesn't matter; just the PRNG. I might even have seeded with a constant or taken the seed from the user.</div>
<div><br></div><div>Seeding from urandom will make your output "more random" for some unquantifiable meaning of the phrase.</div><div><br></div><div>If you want cryptographic randomness, you probably shouldn't be writing your own library if you can avoid it.<br>
<br><div class="gmail_quote">On Wed, Jan 5, 2011 at 7:21 PM, z_axis <span dir="ltr"><<a href="mailto:z_axis@163.com">z_axis@163.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
picoSec :: IO Integer<br>
picoSec = do<br>
t <- ctPicosec `liftM` (getClockTime >>= toCalendarTime)<br>
return t<br>
<br>
rollDice :: Int -> IO Int<br>
rollDice n = do<br>
ps <- picoSec<br>
return $ (take 1 $ randomRs (1,n) $ mkStdGen $ fromInteger ps) !! 0<br>
<br>
The above code uses `ctPicosec` as seed. Is it better to use the output of<br>
/dev/urandom as seed ?<br>
<br>
Sincerely!<br>
<br>
-----<br>
e^(π.i) + 1 = 0<br>
<font color="#888888">--<br>
View this message in context: <a href="http://haskell.1045720.n5.nabble.com/What-s-the-best-seed-for-random-API-tp3329807p3329807.html" target="_blank">http://haskell.1045720.n5.nabble.com/What-s-the-best-seed-for-random-API-tp3329807p3329807.html</a><br>
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><div> Alex R</div></div><br>
</div>