Share via


Crypto.Hash Method

Definition

Overloads

Hash(Byte[], String)

Returns a hash value for the specified byte array.

Hash(String, String)

Returns a hash value for the specified string.

Hash(Byte[], String)

Returns a hash value for the specified byte array.

public static string Hash (byte[] input, string algorithm = "sha256");
static member Hash : byte[] * string -> string
Public Shared Function Hash (input As Byte(), Optional algorithm As String = "sha256") As String

Parameters

input
Byte[]

The data to provide a hash value for.

algorithm
String

The algorithm that is used to generate the hash value. The default is "sha256".

Returns

The hash value for input as a string of hexadecimal characters.

Exceptions

input is null.

Applies to

Hash(String, String)

Returns a hash value for the specified string.

public static string Hash (string input, string algorithm = "sha256");
static member Hash : string * string -> string
Public Shared Function Hash (input As String, Optional algorithm As String = "sha256") As String

Parameters

input
String

The data to provide a hash value for.

algorithm
String

The algorithm that is used to generate the hash value. The default is "sha256".

Returns

The hash value for input as a string of hexadecimal characters.

Exceptions

input is null.

Applies to