Download the PHP package mrbrownnl/random-nickname-generator without Composer
On this page you can find all versions of the php package mrbrownnl/random-nickname-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mrbrownnl/random-nickname-generator
More information about mrbrownnl/random-nickname-generator
Files in mrbrownnl/random-nickname-generator
Package random-nickname-generator
Short Description Random nickname generator
License MIT
Homepage https://github.com/mrbrownnl/random-nickname-generator
Informations about the package random-nickname-generator
PHP random nickname generator
Generates random nicknames based on an adjective (optional) + name + number (optional).
Installation
You can install the package via composer:
Basic usage
Using the Laravel facade
If you are using Laravel 5.5 and up, the service provider will automatically get registered.
For older versions of Laravel (<5.5), you have to add the service provider:
config/app.php
To override the default config parameters in Laravel you can publish the config file to and specify your own parameters. `
Using the facade:
or test it:
Default config parameters
The default package dictionaries are used when no or empty dictionaries are specified on class instantiating.
Function reference
Function | Description |
---|---|
Generates a random nickname which is not stored in the uniquely generated nickname list or checked for uniqueness. | |
Generates a unique random nickname which is not in the given array. | |
Returns the total number of possible unique nicknames with the given configuration parameters. |
Performance
The table below shows how much time it takes to generate a unique name.
While compiling custom adjective or name dictionaries, keep in mind that performance drops drastically if only 1% or less unique nicknames are left.
The table below shows the performance when 150.000 unique nicknames are possible.
Available nicknames | Time |
---|---|
100 % | 0.001 s |
70 % | 0.006 s |
40 % | 0.014 s |
10 % | 0.025 s |
5 % | 0.030 s |
1 % | 0.060 s |
Changelog
Please see CHANGELOG for more information what has changed recently.
License
The MIT License (MIT). Please see License File for more information.
All versions of random-nickname-generator with dependencies
ext-json Version *