PHP code example of hedronium / casus

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

    

hedronium / casus example snippets



//Include the Composer Autoloader

echo $casus->integer();


$casus = new \hedronium\Casus\Casus();
$random_generator = $casus->getGenerator();
echo $random_generator->integer();

    > $ranges = [
    >   [65,90],
    >   [97,122],
    >   [48,57]
    > ];
    > 
    > asciiRange(32, $ranges)
    > 

$casus = new Casus(false);

$generator = new \hedronium\Casus\OpenSSL();
$casus = new Casus(true, $generator);


class SuperGenerator extends \hedronium\Casus\Generator
{
    public function integer($min, $max)
    {
        return rand($min, $max);
    }
}


$generator = new SuperGenerator();
$casus = new \hedronium\Casus\Casus(false, $generator);


$random = new SuperGenerator();


class SuperGenerator extends \hedronium\Casus\Generator
{
    protected $secure = true;
    
    public function integer($min, $max)
    {
        return rand($min, $max);
    }
}


de_once __DIR__.'/GeneratorTest.php';

class SuperGeneratorTest extends \GeneratorTest
{
    public function setUp() {
        $this->casus = new \AwesomePerson\SuperGenerator();
    }
}