ARTLUNG LAB Share

January 3, 2009

20 Random Alphanumeric Passwords

The passwords:

No record is made of these passwords.



Deprecated: Implicit conversion from float 1869049.9999999998 to int loses precision in /usr/home/crawberts/public_html/lab.artlung.com/web/password-maker/PasswordGenerator.php on line 43

Deprecated: Implicit conversion from float 1869300.0000000002 to int loses precision in /usr/home/crawberts/public_html/lab.artlung.com/web/password-maker/PasswordGenerator.php on line 43

Deprecated: Implicit conversion from float 1869570.0000000002 to int loses precision in /usr/home/crawberts/public_html/lab.artlung.com/web/password-maker/PasswordGenerator.php on line 43
XDUcL8C6VQ2aNPsYjG2P
Deprecated: Implicit conversion from float 1870400.0000000002 to int loses precision in /usr/home/crawberts/public_html/lab.artlung.com/web/password-maker/PasswordGenerator.php on line 43

Deprecated: Implicit conversion from float 1870719.9999999998 to int loses precision in /usr/home/crawberts/public_html/lab.artlung.com/web/password-maker/PasswordGenerator.php on line 43

Deprecated: Implicit conversion from float 1870970.0000000002 to int loses precision in /usr/home/crawberts/public_html/lab.artlung.com/web/password-maker/PasswordGenerator.php on line 43

Deprecated: Implicit conversion from float 1871510.0000000002 to int loses precision in /usr/home/crawberts/public_html/lab.artlung.com/web/password-maker/PasswordGenerator.php on line 43

Deprecated: Implicit conversion from float 1871829.9999999998 to int loses precision in /usr/home/crawberts/public_html/lab.artlung.com/web/password-maker/PasswordGenerator.php on line 43
uWgnKA9GWVYBD6PV8BDm
Deprecated: Implicit conversion from float 1872080.0000000002 to int loses precision in /usr/home/crawberts/public_html/lab.artlung.com/web/password-maker/PasswordGenerator.php on line 43
DJN9SJ4LChfteeNTGHFP
Deprecated: Implicit conversion from float 1874010.0000000002 to int loses precision in /usr/home/crawberts/public_html/lab.artlung.com/web/password-maker/PasswordGenerator.php on line 43
DTgscZRJZ3QFfWzBxXXA DxGHzgYMbF2oXRvLyHDN RjSunfJvDHkVGNswKtGk
Deprecated: Implicit conversion from float 1878489.9999999998 to int loses precision in /usr/home/crawberts/public_html/lab.artlung.com/web/password-maker/PasswordGenerator.php on line 43

Deprecated: Implicit conversion from float 1878749.9999999998 to int loses precision in /usr/home/crawberts/public_html/lab.artlung.com/web/password-maker/PasswordGenerator.php on line 43
mRyBvgeGrMEytpT8kFNg
Deprecated: Implicit conversion from float 1879280.0000000002 to int loses precision in /usr/home/crawberts/public_html/lab.artlung.com/web/password-maker/PasswordGenerator.php on line 43

Deprecated: Implicit conversion from float 1879599.9999999998 to int loses precision in /usr/home/crawberts/public_html/lab.artlung.com/web/password-maker/PasswordGenerator.php on line 43

Deprecated: Implicit conversion from float 1879850.0000000002 to int loses precision in /usr/home/crawberts/public_html/lab.artlung.com/web/password-maker/PasswordGenerator.php on line 43
kyTuapqMDHbwTN2xjXrD uyND4wo6HaW26YFhn2QN
Deprecated: Implicit conversion from float 1882630.0000000002 to int loses precision in /usr/home/crawberts/public_html/lab.artlung.com/web/password-maker/PasswordGenerator.php on line 43

Deprecated: Implicit conversion from float 1883720.0000000002 to int loses precision in /usr/home/crawberts/public_html/lab.artlung.com/web/password-maker/PasswordGenerator.php on line 43
FMcf772B6qnpmuWegKqz tjdemYJVSErJuDgqdJWA swjZZyKftxEAEuaLm7eo JWKJDmHUmmYk3NdsunBX Gu7KrYUjXZauL7mdeumZ RUVbwUKvfTeTZUWCFYuC f3PCURsQaFhgfHDv2KpF JbDyHMfmusjSXmAN9pXp nupLu7VSKMgshUgAxUs7 9JtvRbvqXkLfEWCGgPFH AW6j7tRqxf9RYYCd2asJ

The code for the class


<?php

/**
 * Class PasswordGenerator
 *
 * @category PHP
 * @package  Classes
 * @author   Joe Crawford <joe@artlung.com>
 * @license  GPL 2.0+ - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * @version  Release: 1.0
 * @link     https://artlung.com/
 * @since    2024-12-03
 */
class PasswordGenerator
{

    public static 
$letters "2346789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghjkmnopqrstuvwxyz";
    public static 
$length "20";
    public 
$letters_array;

    
/**
     * PasswordGenerator constructor.
     */
    
function __construct()
    {
        
$this->letters_array = array();

        for (
$a 0$a strlen(self::$letters); $a++) {
            
$this->letters_array[] = self::$letters[$a];
        }
    }


    
/**
     * Make password
     *
     * @return string
     */
    
function make(): string
    
{
        
$password '';
        for (
$i 0$i self::$length$i++) {
            
srand((float)microtime() * 10000000);
            
$password .= $this->letters_array[array_rand($this->letters_array)];
        }
        return 
$password;

    }

    
/**
     * Print one password
     *
     * @return void
     */
    
function printOne()
    {
        print 
$this->make();
    }

    
/**
     * Print many passwords
     *
     * @param $num
     *
     * @return void
     */
    
function printMany($num)
    {
        for (
$i 0$i $num$i++) {
            
$this->printOne();
            print 
"\n";
        }
    }


}

How to invoke the class

$PG = new PasswordGenerator();
$PG->printMany(20);