Answers for "random alphanumeric generator"

PHP
28

php generate random alphanumeric string

function generateRandomString($length = 25) {
    $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
    $charactersLength = strlen($characters);
    $randomString = '';
    for ($i = 0; $i < $length; $i++) {
        $randomString .= $characters[rand(0, $charactersLength - 1)];
    }
    return $randomString;
}
//usage 
$myRandomString = generateRandomString(5);
Posted by: Guest on October-30-2019
4

generate random alphanumeric string c#

Namespace: System.Web.Security
public string GeneratePassword()
{
	return Membership.GeneratePassword(10,1);
}
Posted by: Guest on September-30-2020

Code answers related to "random alphanumeric generator"

Browse Popular Code Answers by Language