lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I am using Lua to describe data, which is then easy enough to load, along with some code that is able to serialize table contents back as Lua code.

My problem is that with the random seed introduced with Lua 5.2 to deflect some DoS attacks, iterating over these tables when writing them back yields a different order each time the program is launched.

This is not an issue as far as the data is concerned, but it becomes one when throwing in some version control, because all the lines are swapped around in the file. It becomes therefore difficult to identify the actual content changes in the midst of all the file modifications, and also to merge several changes coming from different branches.

So, I guess that the best solution for this would be for the Lua API to receive an external random seed as argument to lua_newstate, and let the embedder decide whether to provide an actual random data or not. And of course, the standard interpreter would have to have an option to expose this if so desired.

Any thought about this?