Module inquiry: random id / variable

Anton Yuzhaninov citrin at citrin.ru
Fri Nov 13 12:25:40 MSK 2009


icqheretic wrote:
> Hi all. Just fielding a question. Anyone know of a module that will set a random number?
> 
> For example:
> seedrandom on;
> 
> The goal is to have the value stored / accessible throug a variable:
> 
> $randomid
> 
> Just wondering if such a module exists and if not, suggestions on a starting point -- perphaps a module that does something similar?  Time is pressing here, so I'd rather modify as little as possible.

This can be done by embedded perl

perl_set $random_id 'sub { int(rand(2**32)); }';

-- 
 Anton Yuzhaninov





More information about the nginx mailing list