UtilHashingComputeHashOfStringT(String, Encoding) Method
Computes a hash for the specified string using the given hash algorithm.
Namespace: DevCase.Core.Security.Cryptography.HashingAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static string ComputeHashOfString<T>(
string str,
Encoding enc
)
where T : HashAlgorithm
Public Shared Function ComputeHashOfString(Of T As HashAlgorithm) (
str As String,
enc As Encoding
) As String
Dim str As String
Dim enc As Encoding
Dim returnValue As String
returnValue = UtilHashing.ComputeHashOfString(str,
enc)
public:
generic<typename T>
where T : HashAlgorithm
static String^ ComputeHashOfString(
String^ str,
Encoding^ enc
)
static member ComputeHashOfString :
str : string *
enc : Encoding -> string when 'T : HashAlgorithm
No code example is currently available or this language may not be supported.
- str String
-
The string.
- enc Encoding
-
The character Encoding.
- T
-
The HashAlgorithm provider.
String
An Hexadecimal representation of the resulting hash value.
This is a code example.
No code example is currently available or this language may not be supported.
Dim md5 As String = ComputeHashOfString(Of MD5CryptoServiceProvider)("Hello World!", Encoding.ASCII)
Dim sha1 As String = ComputeHashOfString(Of SHA1CryptoServiceProvider)("Hello World!", Encoding.ASCII)
Dim sha256 As String = ComputeHashOfString(Of SHA256CryptoServiceProvider)("Hello World!", Encoding.ASCII)
Dim sha384 As String = ComputeHashOfString(Of SHA384CryptoServiceProvider)("Hello World!", Encoding.ASCII)
Dim sha512 As String = ComputeHashOfString(Of SHA512CryptoServiceProvider)("Hello World!", Encoding.ASCII)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.