private function createUnpronounceable($length, $chars)
    {
        $password = '';

        /*
         * List of character which could be use in the password
         */
        switch ($chars) {
            case 'alphanumeric':
                $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
                $numberOfPossibleCharacters = 62;
                break;

            case 'alphabetical':
                $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
                $numberOfPossibleCharacters = 52;
                break;

            case 'numeric':
                $chars = '0123456789';
                $numberOfPossibleCharacters = 10;
                break;

            case null:
                $chars = '_#@%&ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
                $numberOfPossibleCharacters = 67;
                break;

            default:
                /**
                 * Some characters shouldn't be used.
                 */
                $chars = trim($chars);
                $chars = str_replace(array('+', '|', '$', '^', '/', '\\', ','), '', $chars);

                $numberOfPossibleCharacters = strlen($chars);
                break;
        }

        /*
         * Generate password
         */
        for ($i = 0; $i < $length; ++$i) {
            $num = mt_rand(0, $numberOfPossibleCharacters - 1);
            $password .= $chars[$num];
        }

        /*
         * Return password
         */

        return $password;
    }