Download the PHP package snortlin/nano-id without Composer
On this page you can find all versions of the php package snortlin/nano-id. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download snortlin/nano-id
More information about snortlin/nano-id
Files in snortlin/nano-id
Package nano-id
Short Description A tiny, secure, URL-friendly, unique string ID generator for PHP
License MIT
Informations about the package nano-id
Nano ID
<img src="https://ai.github.io/nanoid/logo.svg" align="right" alt="Nano ID logo by Anton Lovchikov" width="180" height="94">
A tiny, secure, URL-friendly, unique string ID generator for PHP.
This package is PHP implementation of ai's nanoid. Read its documentation for more information.
- Fast. It is faster than UUID.
- Safe. It uses cryptographically strong random APIs. Can be used in clusters.
- Compact. It uses a larger alphabet than UUID (
A-Za-z0-9_-
). So ID size was reduced from 36 to 21 symbols. - Customizable. Size, alphabet and Random Bytes Generator may be overridden.
Installation
The preferred method of installation is via Composer:
Usage
Base usage
Custom alphabet
Faster and Non-Secure
By default, Nano ID uses random bytes generation for security and low collision probability. If you are not so concerned with security and more concerned with performance, you can use the faster non-secure generator.
Tools
- ID size calculator shows collision probability when adjusting the ID alphabet or size.
Credits
- Andrey Sitnik ai for Nano ID.
- Stanislav Lashmanov CyberAP for Predefined character sets to use with Nano ID.