Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Clarify comment
  • Loading branch information
amcasey authored Jul 31, 2024
commit b81bd50fcf941cdf321e7d7aa04c65883a272e43
2 changes: 1 addition & 1 deletion src/Shared/WebEncoders/WebEncoders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static byte[] Base64UrlDecode(string input, int offset, int count)
#if NET9_0_OR_GREATER
// Legacy behavior of Base64UrlDecode supports either Base64 or Base64Url input.
// If it has a - or _, or if it doesn't have + or /, it can be treated as Base64Url.
// Searching for any of them allows us to stop the search as early as we know Base64Url should be used.
// Searching for any of them allows us to stop the search as early as we know whether Base64Url should be used.
ReadOnlySpan<char> inputSpan = input.AsSpan(offset, count);
int indexOfFirstDifferentiator = inputSpan.IndexOfAny(s_base64vsBase64UrlDifferentiators);
if (indexOfFirstDifferentiator < 0 || inputSpan[indexOfFirstDifferentiator] is '-' or '_')
Expand Down