rundiz/serial-number-generator

Generate serial number or random string that is very easy.

v0.1 2016-12-04 12:23 UTC

This package is auto-updated.

Last update: 2024-12-10 04:20:36 UTC


README

Generate serial number or key or random string with number. Tested on PHP 8.4.

Latest Stable Version License Total Downloads

Properties

numberChunks is number of chunks. If you just want to generate random string, set this to 1. It required at least number 1.
Example: If number of chunk is 3. XXXXX-XXXXX-XXXXX

numberLettersPerChunk is number of letters per chunk.
Example: If number of letters per chunk is 2 and number of chunk is 3. XX-XX-XX

separateChunkText is separator text to separate chunks.
Example: If separator is colon. XXXXX:XXXXX:XXXXX:XXXXX:XXXXX

Example

Install

I recommend you to install this library via Composer and use Composer autoload for easily include the files. If you are not using Composer, you have to manually include these files by yourself.
Please make sure that the path to files are correct.

require_once '/path/to/Rundiz/SerialNumberGenerator/SerialNumberGenerator.php';

Usage

Just write this simple code. You can set properties to change some values.

$SerialNumberGenerator = new \Rundiz\SerialNumberGenerator\SerialNumberGenerator();
$serial_number = $SerialNumberGenerator->generate();
unset($SerialNumberGenerator);

echo $serial_number;