> > > >The problem is that because each page request starts a new
console session, the random > > > >seed is often the same (7^5), and
each registering user gets the same "salt" 
> >    ...this is cross platform. For example:
> >    load'guid'
> >    9!:1 (_2) 3!:4 , guids 1    NB. set random seed

This is what I ended up with:
NB. reset random seed if state incremented less than 3 times since
session startup
...
    if. +./(1{::9!:44'')=624,>:i.3 do. 
        9!:1 (_2) 3!:4 , guids 1 end.
    s=. createSalt '' 
...

My thinking is that if I'm using createSalt in a continuous session,
then I don't really want to be resetting the random seed each time.

I suppose the question now becomes whether it's better, in this case, to
forget about Roll altogether & just to use:
  {.(_2) 3!:4 , guids 1
to generate my 4 byte integer salt?  

Whatever the answer, I can see that setting the random seed this way
will come in handy for simulation applications.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to