Download the PHP package better/nanoid without Composer
On this page you can find all versions of the php package better/nanoid. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download better/nanoid
More information about better/nanoid
Files in better/nanoid
Package nanoid
Short Description A copy of nanoid in PHP
License MIT
Homepage https://github.com/Microtribute/better-nanoid
Informations about the package nanoid
Nanoid-php
Overview
Replacement of hidehalo/nanoid-php to work with PHP 7.1+
A tiny (179 bytes), secure URL-friendly unique string ID generator for JavaScript
Safe. It uses cryptographically strong random APIs and guarantees a proper distribution of symbols.
Small. Only 179 bytes (minified and gzipped). No dependencies. It uses Size Limit to control size.
Compact. It uses more symbols than UUID (A-Za-z0-9_-) and has the same number of unique options in just 21 symbols instead of 36.
Install
Via Composer
Usage
Normal
The main module uses URL-friendly symbols (A-Za-z0-9_-) and returns an ID with 21 characters (to have the same collisions probability as UUID v4).
Custom Alphabet or Length
Alphabet must contain 256 symbols or less. Otherwise, the generator will not be secure.
Custom Random Bytes Generator
random
callback must accept the array size and return an array with random numbers.
Credits
License
The MIT License (MIT). Please see License File for more information.