public static function generateWithCustomAlphabet($customAlphabet = '0123456789ABCDEF', $tokenLength = 32) {

        // Set initial alphabet.
        $generator = new RandomStringGenerator($customAlphabet);

        // Change alphabet whenever needed.
        //$generator->setAlphabet($customAlphabet);
        // Call method to generate random string.
        $token = $generator->generate($tokenLength);

        return $token;
    }
public static function generateWithCustomAlphabet($customAlphabet = '0123456789ABCDEF', $tokenLength = 32) {

        // Set initial alphabet.
        $generator = new RandomStringGenerator($customAlphabet);

        // Change alphabet whenever needed.
        //$generator->setAlphabet($customAlphabet);
        // Call method to generate random string.
        $token = $generator->generate($tokenLength);

        return $token;
    }
public static function generateWithCustomAlphabet ( $ customAlphabet = '0123456789ABCDEF' , $ tokenLength = 32 ) { // Set initial alphabet. $ generator = new RandomStringGenerator ( $ customAlphabet ) ; // Change alphabet whenever needed. //$generator->setAlphabet($customAlphabet); // Call method to generate random string. $ token = $ generator -> generate ( $ tokenLength ) ; return $ token ; }
Generate token with custom alphabet
@param string $customAlphabet Set custom alphabet
@param int $tokenLength Set token length.
@return string
Generate token with custom alphabet