Welcome to my programming blog! Click on a few catergories to get started. Or you can click on the projects page and see the bigger things I’m working on.
I’m currently working on a few things and ironing out the kinks, but you can expect this blog to be ready in no time!
This snippet will generate a random sequence of characters that could possibly be used as a secure password. The lowercase L and the number one have been removed, as they look identical.
The original script was written by Clone1018 of Axxim.net. This script is used here with his permission.
<?php
//////////////////////////////////////////////////////////////////////////////////////
// Random Password Generator Script - PHP //
// Original script written by Luke "Clone1018" Strickland from http://axxim.net/ //
// Script used with Luke's permission. //
// //
// Visit http://midnight.iblogger.com/ for more open-source codes and programs! //
//////////////////////////////////////////////////////////////////////////////////////
function createRandomPassword() {
$chars = "abcdefghijkmnopqrstuvwxyz023456789"; //These are the characters that will appear in the final password.
srand((double)microtime()*1000000);
$i = 0;
$pass = '' ;
while ($i <= 10) { //The value of $i determines the length of the final password.
$num = rand() % 33;
$tmp = substr($chars, $num, 1);
$pass = $pass . $tmp;
$i++;
}
return $pass;
}
$password = createRandomPassword();
print "Your randomly generated password is: $password";
?>