[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

[PATCH] math:random() missing its seed

Subject: [PATCH] math:random() missing its seed
From: Nils Werner <nils.werner@xxxxxxxxx>
Date: Thu, 24 Jan 2013 20:04:21 +0100
 [PATCH] math:random() missing its seed
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.