[PHP] Number generator

Questions about programming languages and debugging
Post Reply
User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

[PHP] Number generator

Post by ayu »

Small example of how a number generator could look like. Can be used to create a bruteforce dictionary if you add some more to it.... at least this would be a start of it. Cleaning out my backup folder and found some code i wrote.

Code: Select all

<?php

    $tecken = array('0','1','2','3','4','5','6','7','8','9');

    $a = 0;

    $b = 0;

    $c = 0;

    $d = 0;

    $e = 0;

    $max = 0;

    for( ; $max < pow(10, 5); $max++, $a++)
    {
        if($a == 10)

        {

            $b++;

            $a = 0;

        }

        else if($b == 10)

        {

            $c++;

            $b=0;

        }

        else if($c == 10)

        {

            $d++;

            $c=0;

        }

        else if($d == 10)

        {

            $e++;

            $d=0;

        }

        else if($e == 10)

        {

            $e=0;

        }

        echo $tecken[$e] . $tecken[$d] . $tecken[$c] . $tecken[$b] . $tecken[$a];

    }

?>
"The best place to hide a tree, is in a forest"

User avatar
Swan
Knight of the Sword
Knight of the Sword
Posts: 827
Joined: 18 Oct 2006, 16:00
17
Contact:

Post by Swan »

sterling work as ever cats. Bravo!

Post Reply