lua-users home
lua-l archive

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

On Sun, 17 Jan 2010 13:28:23 -0800
Stefan <> wrote:

> If one has access to a good Lua bit lib, one can use a MD5 hash 
> derivative for better short-term distribution of result values. Just 
> split the 128 bit hash into multiple groups of bits (4 of 32?),
> combine them somehow (XOR?), and interpret the result as an xx (32 in
> this case) bit integer. This would be made much easier and efficient
> with the inclusion of binary string bit operations, of course.

Going dangerously off-topic; surely a good hash means you can just
truncate to the number of bits you require.  No need to "rehash" the
output of the hash by adding them up.