dev-master
9999999-devRandom string generator library
MIT
The Requires
- php ~7.1
The Development Requires
Random string generator library
Simple random string generator library. String generator is defined by interface \Idoheo\StringGenerator\StringGeneratorInterface., (*1)
The following string generators are pre implemented:, (*2)
Generator class | Generated string |
---|---|
Idoheo\StringGenerator\StringGenerator\AlnumCharStringGenerator | Alphanumeric string with upper and lowercase chars |
Idoheo\StringGenerator\StringGenerator\HexStringGenerator | Hexadecimal string generator (lowercase chars) |
Idoheo\StringGenerator\StringGenerator\NqCharStringGenerator | NQCHAR = %x21 / %x23-5B / %x5D-7E |
Idoheo\StringGenerator\StringGenerator\NqsCharStringGenerator | NQSCHAR = %x20-21 / %x23-5B / %x5D-7E |
Idoheo\StringGenerator\StringGenerator\VsCharStringGenerator | VSCHAR = %x20-7E |
Generator class | Generated string |
---|---|
Idoheo\StringGenerator\MappedStringGenerator | String of characters provided in array passed to constructor |
To help writing your own generator, the following two abstract classes can be extended:, (*3)
For this class you have to implement ::executeStringGeneration() method. $length parameter is already checked to be non-negative integer value, so no checking (and exception throwing) from your part is needed in case of invalid $length specified., (*4)
For this class you have to implement ::getCharacter() method to return next string character. As this is extending previous mentioned class, no checks on $length variable are needed., (*5)
Random string generator library
MIT