CryptographicHash CryptographicHash CryptographicHash CryptographicHash Class

Represents a reusable hashing object and contains the result of a hashing operation.

Syntax

Declaration

public sealed class CryptographicHashpublic sealed class CryptographicHashPublic NotInheritable Class CryptographicHashpublic sealed class CryptographicHash

Remarks

Call the CreateHash() or CreateHash(IBuffer) method to create a CryptographicHash object. You can open a hash algorithm provider, by name, for any of the following algorithm names:

  • MD5
  • SHA1
  • SHA256
  • SHA384
  • SHA512

Examples

[!code-csharpShowAppend]

Methods summary

Appends a binary encoded string to the data stored in the CryptographicHash object.

Gets hashed data from the CryptographicHash object and resets the object.

Methods

  • Append(IBuffer)
    Append(IBuffer)
    Append(IBuffer)
    Append(IBuffer)

    Appends a binary encoded string to the data stored in the CryptographicHash object.

    public void Append(IBuffer data)public void Append(IBuffer data)Public Function Append(data As IBuffer) As voidpublic void Append(IBuffer data)

    Parameters

    Remarks

    Call the GetValueAndReset() method to retrieve data from the CryptographicHash object and empty the buffer.

  • GetValueAndReset()
    GetValueAndReset()
    GetValueAndReset()
    GetValueAndReset()

    Gets hashed data from the CryptographicHash object and resets the object.

    public IBuffer GetValueAndReset()public IBuffer GetValueAndReset()Public Function GetValueAndReset() As IBufferpublic IBuffer GetValueAndReset()

    Returns

    Remarks

    Call the Append(IBuffer) method to add data to the CryptographicHash object.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute

Details

Assembly

Windows.Security.Cryptography.Core.dll