Crypto.Hash Method (String, String)
Returns a hash value for the specified string.
Namespace: System.Web.Helpers
Assembly: System.Web.Helpers (in System.Web.Helpers.dll)
Syntax
'Declaration
Public Shared Function Hash ( _
input As String, _
algorithm As String _
) As String
'Usage
Dim input As String
Dim algorithm As String
Dim returnValue As String
returnValue = Crypto.Hash(input, algorithm)
public static string Hash(
string input,
string algorithm
)
public:
static String^ Hash(
String^ input,
String^ algorithm
)
static member Hash :
input:string *
algorithm:string -> string
public static function Hash(
input : String,
algorithm : String
) : String
Parameters
- input
Type: System.String
The data to provide a hash value for.
- algorithm
Type: System.String
The algorithm that is used to generate the hash value. The default is "sha256".
Return Value
Type: System.String
The hash value for input as a string of hexadecimal characters.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | input is null reference (Nothing in Visual Basic). |