Firesphere\BootstrapMFA\Generators\CodeGenerator
Class CodeGenerator Slightly modified version of a generic generator class It's modified to fit the SilverStripe config
Synopsis
class CodeGenerator
{
- // constants
- const CHARS_UPPER = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
- const CHARS_LOWER = 'abcdefghijklmnopqrstuvqxyz';
- const NUMBERS = '0123456789';
- const CASE_UPPER = 'upper';
- const CASE_LOWER = 'lower';
- const CASE_MIXED = 'mixed';
- const TYPE_ALPHA = 'alpha';
- const TYPE_NUMERIC = 'numeric';
- const TYPE_ALNUM = 'alnum';
- // members
- protected static CodeGenerator $global_inst;
- private $case;
- private $type;
- private $length;
- private $validChars;
- // methods
- public $this uppercase()
- public $this lowercase()
- public $this numbersonly()
- public $this charactersonly()
- public $this setChars()
- public string __toString()
- public string generate()
- private string validChars()
- public string getType()
- public static mixed global_inst()
- public $this mixedcase()
- public $this alphanumeric()
- public mixed getCase()
- public mixed getLength()
- public $this setLength()
Hierarchy
Uses
- SilverStripe\Core\Config\Configurable
- SilverStripe\Core\Injector\Injectable
Constants
Name | Value |
---|---|
CHARS_UPPER | 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' |
CHARS_LOWER | 'abcdefghijklmnopqrstuvqxyz' |
NUMBERS | '0123456789' |
CASE_UPPER | 'upper' |
CASE_LOWER | 'lower' |
CASE_MIXED | 'mixed' |
TYPE_ALPHA | 'alpha' |
TYPE_NUMERIC | 'numeric' |
TYPE_ALNUM | 'alnum' |
Members
private
- $case — string
- $length — integer
- $type — string
- $validChars — string
protected
- $global_inst — Firesphere\BootstrapMFA\Generators\CodeGenerator
Methods
private
public
- __toString()
- alphanumeric()
- charactersonly()
- generate() — Generate a random resulting string
- getCase()
- getLength()
- getType()
- global_inst()
- lowercase()
- mixedcase()
- numbersonly()
- setChars()
- setLength()
- uppercase()