Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Random 32 bit string Function

Jim Bunderfeld
The Coder
Join date: 1 Mar 2004
Posts: 161
06-08-2006 13:30
Hey I thought I would just post this to help people learn LSL, most coders probaby know how to do this quite simply.

CODE

//Random 32-bit String Function
// Written by Jim Bunderfeld 6/8/06 MM/DD/YY
// Der Monat/Der Tag/Das Jahr
// Released under GPL License
// Licensing information at http://www.gnu.org/copyleft/gpl.html
// Danke xD
string Random32String()
{
string characters = "abcdefghijklmnopqrstuvwxyz0123456789~`!@#$%^&*()_+-=";
integer count = llStringLength(characters);
integer i;
string result;
for(i = 0;i < 32;i ++)
{
integer rand = (integer)llFrand((float)count - 0);
result += llGetSubString(characters,rand,rand++);
}
return result;
}
default
{
state_entry()
{
llSay(0,Random32String());
}
}
_____________________
| - Linux Users - | #SecondLifeLinux on IRC.EnterTheGame.com
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Discussion Thread
06-08-2006 21:04
/54/63/112699/1.html
_____________________
i've got nothing. ;)