generateCodeChallenge static method

String generateCodeChallenge(
  1. String codeVerifier
)

Implementation

static String generateCodeChallenge(String codeVerifier) {
  var bytes = latin1.encode(codeVerifier);
  var digest = sha256.convert(bytes);

  String base64Str = Base64Encoder.urlSafe().convert(digest.bytes);

  return base64Str.replaceAll("=", "");
}