generateChatGptPkceVerifier function

String generateChatGptPkceVerifier()

Implementation

String generateChatGptPkceVerifier() {
  const alphabet =
      'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~';
  final random = _secureRandom();
  final bytes = Uint8List(96);
  for (var i = 0; i < bytes.length; i++) {
    bytes[i] = alphabet.codeUnitAt(random.nextInt(alphabet.length));
  }
  return String.fromCharCodes(bytes);
}