Skip to content

Generators

Trafford Fewster edited this page Nov 13, 2023 · 1 revision

Summary

This package uses generators to generate and validate codes, the base generator can be found here this can then be easily expanded to support your custom needs or be constructed with different settings.

BaseGenerator Settings.

When constructing the generator you can set 6 augments they are below:

numberOnly (bool)

Default: true Whether the code should be numbers only, if false it will be alpha numeric.

length (int)

Default: 6 The length the code needs to be.

allowPalindrome (bool)

Default: false Whether to allow palindromes or not.

maxRepeatingCharacters (int)

Default: 3 The maximum repeating characters.

sequenceLength (int)

Default: 4 The maximum sequence length.

uniqueCharacters (int)

Default: 3 The amount of unique characters needed in the code.