Net Encryption Library
HashStringHex(HashProvider,String,String) Method
Example 






KellermanSoftware.NetEncryptionLibrary Namespace > Encryption Class > HashStringHex Method : HashStringHex(HashProvider,String,String) Method
Type of the hash.
The input.
The secret key.
Return a Hexadecimal encoded one way hash of a string
Syntax
'Declaration
 
Public Overloads Function HashStringHex( _
   ByVal hashType As HashProvider, _
   ByVal input As System.String, _
   ByVal key As System.String _
) As System.String
'Usage
 
Dim instance As Encryption
Dim hashType As HashProvider
Dim input As System.String
Dim key As System.String
Dim value As System.String
 
value = instance.HashStringHex(hashType, input, key)
public System.string HashStringHex( 
   HashProvider hashType,
   System.string input,
   System.string key
)
public function HashStringHex( 
    hashType: HashProvider;
    input: System.String;
    key: System.String
): System.String; 
public function HashStringHex( 
   hashType : HashProvider,
   input : System.String,
   key : System.String
) : System.String;
public: System.string* HashStringHex( 
   HashProvider hashType,
   System.string* input,
   System.string* key
) 
public:
System.String^ HashStringHex( 
   HashProvider hashType,
   System.String^ input,
   System.String^ key
) 

Parameters

hashType
Type of the hash.
input
The input.
key
The secret key.

Return Value

Hashed string OR string.empty on error
Example
Encryption encryption = new Encryption(); //Trial Mode
//Encryption encryption = new Encryption("place user name here", "place license key here"); //License Mode
 
string input = "test";
 
string results = encryption.HashStringHex(HashProvider.SHA512, input, "secret");
Console.WriteLine(results);
Dim encryption As New Encryption() 'Trial Mode
'Dim encryption As New Encryption("place user name here", "place license key here") 'License Mode
 
Dim input As String = "test"
 
Dim results As String = encryption.HashStringHex(HashProvider.SHA512, input, "secret")
Console.WriteLine(results)
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Encryption Class
Encryption Members
Overload List