Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
6 contributors

Users who have contributed to this file

@mairaw @TianqiZhang @dend @yishengjin1413 @rpetrusha @dendeli-msft
400 lines (378 sloc) 26.9 KB
<Type Name="SHA256Managed" FullName="System.Security.Cryptography.SHA256Managed">
<TypeSignature Language="C#" Value="public class SHA256Managed : System.Security.Cryptography.SHA256" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit SHA256Managed extends System.Security.Cryptography.SHA256" />
<TypeSignature Language="DocId" Value="T:System.Security.Cryptography.SHA256Managed" />
<TypeSignature Language="VB.NET" Value="Public Class SHA256Managed&#xA;Inherits SHA256" />
<TypeSignature Language="C++ CLI" Value="public ref class SHA256Managed : System::Security::Cryptography::SHA256" />
<TypeSignature Language="F#" Value="type SHA256Managed = class&#xA; inherit SHA256" />
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Algorithms</AssemblyName>
<AssemblyVersion>4.3.0.0</AssemblyVersion>
<AssemblyVersion>4.3.1.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Security.Cryptography.SHA256</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1">
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Computes the <see cref="T:System.Security.Cryptography.SHA256" /> hash for the input data using the managed library.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The hash is used as a unique value of fixed size representing a large amount of data. Hashes of two sets of data should match if and only if the corresponding data also matches. Small changes to the data result in large unpredictable changes in the hash.
The hash size for the <xref:System.Security.Cryptography.SHA256Managed> algorithm is 256 bits.
## Examples
The following example calculates the SHA-256 hash for all files in a directory.
[!code-cpp[Classic SHA256 Example#1](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic SHA256 Example/CPP/source.cpp#1)]
[!code-csharp[Classic SHA256 Example#1](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SHA256 Example/CS/source.cs#1)]
[!code-vb[Classic SHA256 Example#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic SHA256 Example/VB/source.vb#1)]
]]></format>
</remarks>
<related type="Article" href="~/docs/standard/security/cryptographic-services.md">Cryptographic Services</related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public SHA256Managed ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.SHA256Managed.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; SHA256Managed();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Algorithms</AssemblyName>
<AssemblyVersion>4.3.0.0</AssemblyVersion>
<AssemblyVersion>4.3.1.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.SHA256Managed" /> class using the managed library.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The hash is used as a unique value of fixed size representing a large amount of data. Hashes of two sets of data should match if and only if the corresponding data also matches. Small changes to the data result in large unpredictable changes in the hash.
The hash size for the <xref:System.Security.Cryptography.SHA256Managed> algorithm is 256 bits.
> [!IMPORTANT]
> If you enable the following security setting either in the Local Security Policy or as part of Group Policy you will get an <xref:System.InvalidOperationException> when you attempt to use this constructor:
>
> **System cryptography: Use FIPS compliant algorithms for encryption, hashing, and signing**
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">The Federal Information Processing Standards (FIPS) security setting is enabled. This implementation is not part of the Windows Platform FIPS-validated cryptographic algorithms.</exception>
<related type="Article" href="~/docs/standard/security/cryptographic-services.md">Cryptographic Services</related>
</Docs>
</Member>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="protected override void Dispose (bool disposing);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Dispose(bool disposing) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.SHA256Managed.Dispose(System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub Dispose (disposing As Boolean)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void Dispose(bool disposing);" />
<MemberSignature Language="F#" Value="override this.Dispose : bool -&gt; unit" Usage="sHA256Managed.Dispose disposing" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Algorithms</AssemblyName>
<AssemblyVersion>4.3.0.0</AssemblyVersion>
<AssemblyVersion>4.3.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="disposing" Type="System.Boolean" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.8;netstandard-2.1;xamarinios-10.8" />
</Parameters>
<Docs>
<param name="disposing">
<see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.</param>
<summary>Releases unmanaged resources used by the <see cref="T:System.Security.Cryptography.SHA256Managed" /> object and optionally releases the managed resources.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is called by the public <xref:System.Security.Cryptography.HashAlgorithm.Dispose> method and the <xref:System.Security.Cryptography.SHA256Managed.Finalize%2A> method. <xref:System.Security.Cryptography.HashAlgorithm.Dispose> invokes the protected <xref:System.Security.Cryptography.SHA256Managed.Dispose(System.Boolean)> method with the `disposing` parameter set to `true`. <xref:System.Security.Cryptography.SHA256Managed.Finalize%2A> invokes <xref:System.Security.Cryptography.SHA256Managed.Dispose(System.Boolean)> with `disposing` set to `false`.</remarks>
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Finalize">
<MemberSignature Language="C#" Value="~SHA256Managed ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Finalize() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.SHA256Managed.Finalize" />
<MemberSignature Language="VB.NET" Value="Finalize ()" />
<MemberSignature Language="C++ CLI" Value="!SHA256Managed ()" />
<MemberSignature Language="F#" Value="override this.Finalize : unit -&gt; unit" Usage="sHA256Managed.Finalize " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Algorithms</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<ReturnValue>%2A&gt;
<ReturnType>System.Void</ReturnType></ReturnValue>
<Parameters />
<Docs>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="HashCore">
<MemberSignature Language="C#" Value="protected override void HashCore (ReadOnlySpan&lt;byte&gt; source);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void HashCore(valuetype System.ReadOnlySpan`1&lt;unsigned int8&gt; source) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.SHA256Managed.HashCore(System.ReadOnlySpan{System.Byte})" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub HashCore (source As ReadOnlySpan(Of Byte))" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void HashCore(ReadOnlySpan&lt;System::Byte&gt; source);" />
<MemberSignature Language="F#" Value="override this.HashCore : ReadOnlySpan&lt;byte&gt; -&gt; unit" Usage="sHA256Managed.HashCore source" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Algorithms</AssemblyName>
<AssemblyVersion>4.3.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.ReadOnlySpan&lt;System.Byte&gt;" Index="0" FrameworkAlternate="netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="source">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="HashCore">
<MemberSignature Language="C#" Value="protected override sealed void HashCore (byte[] array, int ibStart, int cbSize);" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void HashCore(unsigned int8[] array, int32 ibStart, int32 cbSize) cil managed" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.SHA256Managed.HashCore(System.Byte[],System.Int32,System.Int32)" FrameworkAlternate="xamarinios-10.8;xamarinmac-3.0" />
<MemberSignature Language="VB.NET" Value="Protected Overrides NotOverridable Sub HashCore (array As Byte(), ibStart As Integer, cbSize As Integer)" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void HashCore(cli::array &lt;System::Byte&gt; ^ array, int ibStart, int cbSize);" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0" />
<MemberSignature Language="F#" Value="override this.HashCore : byte[] * int * int -&gt; unit" Usage="sHA256Managed.HashCore (array, ibStart, cbSize)" FrameworkAlternate="xamarinios-10.8;netcore-3.0" />
<MemberSignature Language="C#" Value="protected override void HashCore (byte[] rgb, int ibStart, int cbSize);" FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinmac-3.0" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void HashCore(unsigned int8[] rgb, int32 ibStart, int32 cbSize) cil managed" FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinmac-3.0" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub HashCore (rgb As Byte(), ibStart As Integer, cbSize As Integer)" FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinmac-3.0" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void HashCore(cli::array &lt;System::Byte&gt; ^ rgb, int ibStart, int cbSize);" FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinmac-3.0" />
<MemberSignature Language="F#" Value="override this.HashCore : byte[] * int * int -&gt; unit" Usage="sHA256Managed.HashCore (rgb, ibStart, cbSize)" FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinmac-3.0" />
<MemberSignature Language="C#" Value="protected override void HashCore (byte[] data, int start, int length);" FrameworkAlternate="xamarinios-10.8" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void HashCore(unsigned int8[] data, int32 start, int32 length) cil managed" FrameworkAlternate="xamarinios-10.8" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub HashCore (data As Byte(), start As Integer, length As Integer)" FrameworkAlternate="xamarinios-10.8" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void HashCore(cli::array &lt;System::Byte&gt; ^ data, int start, int length);" FrameworkAlternate="xamarinios-10.8" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.SHA256Managed.HashCore(System.Byte[],System.Int32,System.Int32)" FrameworkAlternate="netframework-1.1" />
<MemberSignature Language="F#" Value="override this.HashCore : byte[] * int * int -&gt; unit" Usage="sHA256Managed.HashCore (data, start, length)" FrameworkAlternate="xamarinios-10.8" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Algorithms</AssemblyName>
<AssemblyVersion>4.3.0.0</AssemblyVersion>
<AssemblyVersion>4.3.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="array" Type="System.Byte[]" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0" />
<Parameter Name="rgb" Type="System.Byte[]" Index="0" FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinmac-3.0" />
<Parameter Name="data" Type="System.Byte[]" Index="0" FrameworkAlternate="xamarinios-10.8" />
<Parameter Name="ibStart" Type="System.Int32" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinmac-3.0" />
<Parameter Name="start" Type="System.Int32" Index="1" FrameworkAlternate="xamarinios-10.8" />
<Parameter Name="cbSize" Type="System.Int32" Index="2" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinmac-3.0" />
<Parameter Name="length" Type="System.Int32" Index="2" FrameworkAlternate="xamarinios-10.8" />
</Parameters>
<Docs>
<param name="array">The input data.</param>
<param name="rgb">The input data.</param>
<param name="data">The input data.</param>
<param name="ibStart">The offset into the byte array from which to begin using data.</param>
<param name="start">The offset into the byte array from which to begin using data.</param>
<param name="cbSize">The number of bytes in the array to use as data.</param>
<param name="length">The number of bytes in the array to use as data.</param>
<summary>When overridden in a derived class, routes data written to the object into the <see cref="T:System.Security.Cryptography.SHA256" /> hash algorithm for computing the hash.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is not called by application code.
This abstract method performs the hash computation. Every write to the cryptographic stream object passes the data through this method. For each block of data, this method updates the state of the hash object so a correct hash value is returned at the end of the data stream.
]]></format>
</remarks>
<altmember cref="T:System.Security.Cryptography.HashAlgorithm" />
<related type="Article" href="~/docs/standard/security/cryptographic-services.md">Cryptographic Services</related>
</Docs>
</Member>
<Member MemberName="HashFinal">
<MemberSignature Language="C#" Value="protected override byte[] HashFinal ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance unsigned int8[] HashFinal() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.SHA256Managed.HashFinal" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Function HashFinal () As Byte()" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override cli::array &lt;System::Byte&gt; ^ HashFinal();" />
<MemberSignature Language="F#" Value="override this.HashFinal : unit -&gt; byte[]" Usage="sHA256Managed.HashFinal " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Algorithms</AssemblyName>
<AssemblyVersion>4.3.0.0</AssemblyVersion>
<AssemblyVersion>4.3.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Byte[]</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>When overridden in a derived class, finalizes the hash computation after the last data is processed by the cryptographic stream object.</summary>
<returns>The computed hash code.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is not called by application code. This method finalizes any partial computation and returns the correct hash value of the data stream.
]]></format>
</remarks>
<related type="Article" href="~/docs/standard/security/cryptographic-services.md">Cryptographic Services</related>
</Docs>
</Member>
<Member MemberName="Initialize">
<MemberSignature Language="C#" Value="public override void Initialize ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void Initialize() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.SHA256Managed.Initialize" />
<MemberSignature Language="VB.NET" Value="Public Overrides Sub Initialize ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override void Initialize();" />
<MemberSignature Language="F#" Value="override this.Initialize : unit -&gt; unit" Usage="sHA256Managed.Initialize " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Algorithms</AssemblyName>
<AssemblyVersion>4.3.0.0</AssemblyVersion>
<AssemblyVersion>4.3.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Initializes an instance of <see cref="T:System.Security.Cryptography.SHA256Managed" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The hash is used as a unique value of fixed size representing a large amount of data. Hashes of two sets of data should match if and only if the corresponding data also matches. Small changes to the data result in large unpredictable changes in the hash.
The hash size for the <xref:System.Security.Cryptography.SHA256Managed> algorithm is 256 bits.
]]></format>
</remarks>
<related type="Article" href="~/docs/standard/security/cryptographic-services.md">Cryptographic Services</related>
</Docs>
</Member>
<Member MemberName="TryHashFinal">
<MemberSignature Language="C#" Value="protected override bool TryHashFinal (Span&lt;byte&gt; destination, out int bytesWritten);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance bool TryHashFinal(valuetype System.Span`1&lt;unsigned int8&gt; destination, [out] int32&amp; bytesWritten) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.SHA256Managed.TryHashFinal(System.Span{System.Byte},System.Int32@)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Function TryHashFinal (destination As Span(Of Byte), ByRef bytesWritten As Integer) As Boolean" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override bool TryHashFinal(Span&lt;System::Byte&gt; destination, [Runtime::InteropServices::Out] int % bytesWritten);" />
<MemberSignature Language="F#" Value="override this.TryHashFinal : Span&lt;byte&gt; * -&gt; bool" Usage="sHA256Managed.TryHashFinal (destination, bytesWritten)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Algorithms</AssemblyName>
<AssemblyVersion>4.3.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="destination" Type="System.Span&lt;System.Byte&gt;" Index="0" FrameworkAlternate="netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1" />
<Parameter Name="bytesWritten" Type="System.Int32" RefType="out" Index="1" FrameworkAlternate="netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="destination">To be added.</param>
<param name="bytesWritten">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.