Download the PHP package hemker/random-string without Composer
On this page you can find all versions of the php package hemker/random-string. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hemker/random-string
More information about hemker/random-string
Files in hemker/random-string
Package random-string
Short Description Creation of random strings (e.g. for coupon codes in webshops, hashes for one-time links/passwords, accound codes, etc. pp.)
License MIT
Informations about the package random-string
random-string
random-string is a service to create strings of jumbled chars easily. Some use cases:
- coupon codes in web shops
- hashes for one-time links/passwords
- account codes
Some Features:
- full customizable chars to use
- presets of chars available (digits, BASE16, BASE32...)
- No length limit
- works well with frameworks like Symfony (dependency injection), or standalone
Installation
Open a command console, enter your project directory and execute:
If you don't use Composer, give it a try. It's a reason Composer is the most used package manager for PHP! And it's easy to use. See composer's web page for more information.
Otherwise, download all source files of this project and include src/
into your own project at best fitting place.
Usage
Imagine you want to create a random string of length 6, containing digits only. All you need is to interact with one single class.
Typing all allowed chars is boring, hard to read and error-prone? Of course! Use presets instead:
You have to create a lot of strings, like 500 voucher codes? Simple as that!
Note
If a negative number or 0 is passed to
__construct()
orlength()
an exception is thrown (of typeHemker\RandomString\Exception\InvalidArgumentException
which extends\InvalidArgumentException
).
Contributing
You'd like to see a feature? Or you found a bug? Awesome! Open source is fueled by everyone's pieces of improvements. Please feel free to create or comment an issue. Every contribution, no matter how small, is welcome!
You're a programmer? Perfect. Pull requests are appreciated! Note this hints:
- This project uses some tools to ensure code quality (phpunit, php-cs-fixer, psalm).
- run
./phive.phar install
to download all needed phars to./tools
- run
./tools/composer.phar --run-script check-all
before pushing code
- run
Note See
composer.json
(section scripts) for all available commands
All versions of random-string with dependencies
ext-bcmath Version *