[prev in list] [next in list] [prev in thread] [next in thread]
List: xsl-list
Subject: [xsl] Re: [PATCH] math:random() missing its seed
From: Nils Werner <nils.werner () gmail ! com>
Date: 2013-01-24 19:10:22
Message-ID: CACYQ+4y=jKmtUQHZagpzp4Ew3CT4gf3w_xhDJjhaT0UQ_Nq37w () mail ! gmail ! com
[Download RAW message or body]
Apologies, I didn't realise that this list isn't meant for libxslt
internals but rather for XSLT in general.
On Thu, Jan 24, 2013 at 8:04 PM, Nils Werner <nils.werner@gmail.com> wrote:
> Hey,
>
> I recently noticed that the current implementation of math:random()
> repeatedly always produces the same random numbers.
>
> After looking into the code and digging up a few messages from 2008
> (http://comments.gmane.org/gmane.comp.gnome.lib.xml.general/13910) I
> realised that the current implementation is missing its seed.
>
> My modifications only apply to xsltproc itself. I figured that for now
> software linking to libxslt may either already have run srand() itself
> or may be required to do so in order to use the lib.
>
> I also absolutely understand the need for a deterministic and
> reproducible seed, so besides running srand(time(NULL)) once during
> program startup I implemented a command line parameter --seed-rand
> with wich the seed can be overridden manually.
>
> The patch can be found at
> https://github.com/nils-werner/libxslt/compare/master...seedrand.patch
>
> Regards,
> Nils Werner
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@lists.mulberrytech.com>
--~--
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic