PHP code example of iiifx-production / password-generator

1. Go to this page and download the library: Download iiifx-production/password-generator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

iiifx-production / password-generator example snippets

 php
use iiifx\PasswordGenerator\Length;
use iiifx\PasswordGenerator\Options;
use iiifx\PasswordGenerator\Symbols;
use iiifx\PasswordGenerator\Generator;

$length = new Length( 5 );
$symbols = [
    new Symbols( '1234567890' ),
];
$options = new Options( $length, $symbols );
$generator = new Generator( $options );

echo $generator->generate(); # 47884
echo $generator->generate(); # 62802
echo $generator->generate(); # 35187
 php
use iiifx\PasswordGenerator\Method\MethodOpenSSL;

$length = new Length( 10, 16 ); # 10-16 знаков
$symbols = [
    new Symbols( 'abcdefghijklmnopqrstuvwxyz', 100 ), # Приоритет 100
    new Symbols( 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 50 ), # Приоритет 50
    new Symbols( '1234567890', 50 ), # Приоритет 50
    new Symbols( '!@#$%?&:*+-.', 30 ), # Приоритет 30
];
$options = new Options( $length, $symbols );
$method = new MethodOpenSSL();
$generator = new Generator( $options, $method );

echo $generator->generate(); # Xn64h1:wgDk@@eh
echo $generator->generate(); # lqF&X4ywaAo
echo $generator->generate(); # E8Yk60*qavzVr