Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

random password generator

function rand_string( $length ) {
	$str = "";
	$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

	$size = strlen( $chars );
	for( $i = 0; $i < $length; $i++ ) {
		$str .= $chars[ rand( 0, $size - 1 ) ];
	}

	return $str;
}
//and call the function this way:
$mypass = rand_string(10);
 
PREVIOUS NEXT
Tagged: #random #password #generator
ADD COMMENT
Topic
Name
6+1 =