[mythtv] [mythtv-commits] mythtv/master commit: c7b18dbc4 by Daniel Kristjansson (daniel-kristjansson)

James Courtier-Dutton james.dutton at gmail.com
Wed Aug 24 07:04:17 UTC 2011

One way to get statistically pseudo random numbers is to get a random seed
for the IV and then just use AES in CBC mode, encryption all zeros should
give you a good pseudo random output. It is not a strong random number for
crypto purposes but fine for other uses.
 On Aug 23, 2011 10:21 PM, "Daniel Kristjansson" <danielk at cuymedia.net>
> On Tue, 2011-08-23 at 23:07 +0200, Jonathan Martens wrote:
>> On 23-8-2011 22:57, Jonathan Martens wrote:
>> > I am afraid that this is the first in a line of things braking windows
>> > compilation as before I did a 'make distclean' I already observed this
> Sorry, I wrote this based on the Microsoft documentation, I didn't
> realize mingw doesn't support those the Microsoft stdlib.h. My
> googling on mingw and random doesn't seem to turn anything up.
> rand() isn't supposed to be used in multi-threaded programs. How
> badly it fails depends on a particular implementation, but I can't
> find any documentation the MINGW rand() implementation.
> If we need to, we can go back to the posix_rand_r() in my previous
> commit but it isn't exactly fast since it uses a mutex. Maybe some
> windows developer can speak up on how to get decent pseudo-random
> numbers in a thread-safe way using mingw?
> As for srandom() we can just put a stub in compat.h for that on
> windows, it just initializes the pseudo-random number generator.
> -- Daniel
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://www.mythtv.org/mailman/listinfo/mythtv-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.mythtv.org/pipermail/mythtv-dev/attachments/20110824/1c412d04/attachment.html 

More information about the mythtv-dev mailing list