CheckSum..::..Generate Method (String, HashMethod)
Generates a cryptographic hash for a given string using a specified hashing algorithm. If the input string is null, 0 will be returned.
Namespace:
Walter.CypherAssembly: Walter.Cypher (in Walter.Cypher.dll)
Syntax
[MethodImplAttribute] [FeatureTagsAttribute] public static int Generate( string source, HashMethod method )
Parameters
- source
- Type: String
The input string to hash.
- method
- Type: HashMethod
The hashing algorithm to use, specified by the [HashMethod] enum.
Return Value
An integer representation of the hash computed from the input string using the specified algorithm, or 0 if the input is null.Remarks
Examples
use SHA256 to compute a hash
int hashValue = CheckSum.Generate("example input", HashMethod.SHA256);