This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Add Span<T> Base64 conversion APIs that support UTF-8 #24888
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8698f4f
Add Span<T> Base64 conversion APIs that support UTF-8.
ahsonkhan 9c5a70a
Optimize the encoding loop when there is plenty of available space
ahsonkhan 4829b19
Optimize EncodeInPlace and update DecodeBaseline perf test.
ahsonkhan 61bcec9
Addressing PR feedback, encode optimization, throw for negative lengths
ahsonkhan bebb7fc
Reenable commented out perf tests.
ahsonkhan 93c44b2
Cap the amount of data to process based on how much that will fit.
ahsonkhan a9065ae
Being explicit with access modifiers to follow guidelines.
ahsonkhan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
namespace System.Buffers | ||
{ | ||
/// <summary> | ||
/// This enum defines the various potential status that can be returned from Span-based operations | ||
/// that support processing of input contained in multiple discontiguous buffers. | ||
/// </summary> | ||
public enum OperationStatus | ||
{ | ||
/// <summary> | ||
/// The entire input buffer has been processed and the operation is complete. | ||
/// </summary> | ||
Done, | ||
/// <summary> | ||
/// The input is partially processed, up to what could fit into the destination buffer. | ||
/// The caller can enlarge the destination buffer, slice the buffers appropriately, and retry. | ||
/// </summary> | ||
DestinationTooSmall, | ||
/// <summary> | ||
/// The input is partially processed, up to the last valid chunk of the input that could be consumed. | ||
/// The caller can stitch the remaining unprocessed input with more data, slice the buffers appropriately, and retry. | ||
/// </summary> | ||
NeedMoreData, | ||
/// <summary> | ||
/// The input contained invalid bytes which could not be processed. If the input is partially processed, | ||
/// the destination contains the partial result. This guarantees that no additional data appended to the input | ||
/// will make the invalid sequence valid. | ||
/// </summary> | ||
InvalidData, | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From @KrzysztofCwalina
Previously, ThrowHelper.cs was not included for netcoreapp, but I updated the project file to always include ThrowHelper.cs. It is the same exception and message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in this file should have zero effect on the inlining or the native code that will be generated. I do not see a problem with, but I do not think they help or hurt anything.