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

Skip to content

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

Closed
wants to merge 1 commit into from
Closed

FromBase64Transform.xml updated to reflect latest code-changes #2895

wants to merge 1 commit into from

Conversation

gfoidl
Copy link
Member

@gfoidl gfoidl commented Jul 31, 2019

@gfoidl
Copy link
Member Author

gfoidl commented Jul 31, 2019

/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.
Copy link
Member Author

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.

Copy link
Contributor

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>
Copy link
Member Author

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?

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;

@bartonjs
Copy link
Member

As far as I know, we wouldn't update the docs site for a change for .NET 5 until it's in preview.

Copy link

@rpetrusha rpetrusha left a 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]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> [!NOTE]
> [!IMPORTANT]

@@ -144,6 +147,9 @@

## Examples
The following example decodes a base 64-encoded file to an output text file.

> [!NOTE]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> [!NOTE]
> [!IMPORTANT]

]]></format>
</remarks>
<value>Always <see langword="true" />.</value>
<remarks>To be added.</remarks>

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.

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]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> [!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]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> [!NOTE]
> [!IMPORTANT]

@gfoidl
Copy link
Member Author

gfoidl commented Aug 3, 2019

Right now my plan would be:

If .NET 5 gets in preview, we can

@rpetrusha
Copy link

Your plan sounds good, @gfoidl. I'll close this PR and look for your PR reverting the changes in dotnet/samples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants