-
Notifications
You must be signed in to change notification settings - Fork 1.6k
FromBase64Transform.xml updated to reflect latest code-changes #2895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
/cc: @rpetrusha |
The following example decodes a base 64-encoded file to an output text file. | ||
|
||
> [!NOTE] | ||
> On .NET implementations where `FromBase64Transform.InputBlockSize` is not `4`, a constant value of `4` should be substituted for the property value. |
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.
Is there any way to specify that before .NET 5 the inputblock size = 1?
So it is more obvious to users.
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.
We can open an issue to track that change for .NET 5 but we wouldn't add this yet
]]></format> | ||
</remarks> | ||
<value>Always <see langword="true" />.</value> | ||
<remarks>To be added.</remarks> |
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.
Copied from CanReuseTransform
. Is this correct?
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.
No, it's not correct:
public int InputBlockSize => 1;
public int OutputBlockSize => 3;
public bool CanTransformMultipleBlocks => false;
public virtual bool CanReuseTransform => true;
As far as I know, we wouldn't update the docs site for a change for .NET 5 until it's in preview. |
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.
No, we wouldn't update the docs for .NET 5 changes until the changes are actually in preview. I hadn't realized that the change to InputBlockSize was a .NET 5 change, and not a .NET Core 3.0 change. There are a couple of choices:
- Revert the change to the example so that it uses a hard-coded value of 4 rather than the InputBlockSize property. This makes the documentation consistent with current behavior.
- Leave the changed example as is, with the note that .NET implementations with an InputBlockSize value other than 4 should use a hard-coded value.
Since the example works but is less performant if an input block size of 1 is specified, I'm inclined to leave the example as is but note that the property value may need to be replaced by a hard-coded value, as this PR does. My suggested changes reflect that.
Thoughts, @bartonjs and @gfoidl? Should we revert the example, or adopt the second approach?
The following example decodes a base 64-encoded file to an output text file. | ||
The following example decodes a base 64-encoded file to an output text file. | ||
|
||
> [!NOTE] |
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.
> [!NOTE] | |
> [!IMPORTANT] |
@@ -144,6 +147,9 @@ | |||
|
|||
## Examples | |||
The following example decodes a base 64-encoded file to an output text file. | |||
|
|||
> [!NOTE] |
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.
> [!NOTE] | |
> [!IMPORTANT] |
]]></format> | ||
</remarks> | ||
<value>Always <see langword="true" />.</value> | ||
<remarks>To be added.</remarks> |
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.
No, it's not correct:
public int InputBlockSize => 1;
public int OutputBlockSize => 3;
public bool CanTransformMultipleBlocks => false;
public virtual bool CanReuseTransform => true;
@@ -465,7 +464,7 @@ | |||
<format type="text/markdown"><![CDATA[ | |||
|
|||
## Remarks | |||
The input block size for this transformation is one byte. | |||
The input block size for this transformation is four bytes. |
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.
This can't be changed until .NET 5.
@@ -619,6 +618,9 @@ For more information about Dispose and Finalize, see [Cleaning Up Unmanaged Reso | |||
|
|||
## Examples | |||
The following example decrypts a base 64-encoded file to an output text file. | |||
|
|||
> [!NOTE] |
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.
> [!NOTE] | |
> [!IMPORTANT] |
@@ -692,6 +694,9 @@ For more information about Dispose and Finalize, see [Cleaning Up Unmanaged Reso | |||
|
|||
## Examples | |||
The following example decrypts a base 64-encoded file to an output text file. | |||
|
|||
> [!NOTE] |
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.
> [!NOTE] | |
> [!IMPORTANT] |
Right now my plan would be:
If .NET 5 gets in preview, we can |
Your plan sounds good, @gfoidl. I'll close this PR and look for your PR reverting the changes in dotnet/samples. |
Cf. dotnet/samples#1098 (review)
Code change: dotnet/corefx#39599
Samples change: dotnet/samples#1098