PHP code example of publero / code-generator

1. Go to this page and download the library: Download publero/code-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/ */

    

publero / code-generator example snippets

 php

$sha1Generator = new Sha1HashGenerator();
$sha1Hash = $sha1Generator->generate();

$md5Generator = new Md5HashGenerator();
$md5Hash = $md5Generator->generate();
 php

$alphabet = 'abcdef';
$codeGenerator = new CustomAlphabetCodeGenerator($alphabet, 8);
$code = $codeGenerator->generate(); // code consisting of 8 a-f characters
$defaultCodeGenerator = new CustomAlphabetCodeGenerator();
$code = $codeGenerator->generate(); // generates 10 character long code of a-zA-Z0-9 characters