public static function generateToken($sMask = null, $aChars = [], $aDigits = [])
    {
        $sMask   = empty($sMask) ? 'AAAA-AAAA-AAAA-AAAA-AAAA-AAAA' : $sMask;
        $aChars  = empty($aChars) ? str_split('abcdefghijklmnopqrstuvwxyz') : $aChars;
        $aDigits = empty($aDigits) ? str_split('0123456789') : $aDigits;

        $aMask    = str_split(strtoupper($sMask));
        $aOut     = [];
        $iMaskLen = count($aMask);

        for ($i = 0; $i < $iMaskLen; $i++) {

            if ($aMask[$i] === 'A') {

                if (mt_rand(0, 1)) {
                    $aOut[] = random_element($aChars);
                } else {
                    $aOut[] = random_element($aDigits);
                }

            } else {
                if ($aMask[$i] === 'C') {

                    $aOut[] = random_element($aChars);

                } else {
                    if ($aMask[$i] === 'D') {

                        $aOut[] = random_element($aDigits);

                    } else {

                        $aOut[] = $aMask[$i];
                    }
                }
            }
        }

        return implode($aOut);
    }