Random Password Generator

From Second Life Wiki
Revision as of 10:20, 27 March 2009 by Jor3l Boa (talk | contribs) (New page: Code: <lsl> //Easy Random Password Generator with Password Length. // // - Created by Jor3l Boa - // // Available under the Creative Commons Attribution-ShareAlike 2.5 license // http://cr...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Code: <lsl> //Easy Random Password Generator with Password Length. // // - Created by Jor3l Boa - // // Available under the Creative Commons Attribution-ShareAlike 2.5 license // http://creativecommons.org/licenses/by-sa/2.5/ // // http://sltools.biz


string randomPass(integer length) {

   string letters = "abcdefghijkmnopqrstuvwxyz234567890";
   string rPass;
   while(llStringLength(rPass) < length)   {
       integer rand = llFloor(llFrand(llStringLength(letters)));
       rPass += llGetSubString(letters,rand,rand);
   }
   return rPass;

}

default {

   state_entry()
   {
       llSay(0,randomPass(10));
   }

} </lsl>