HashMethod Enumeration
Hashing method used in the string extension
Namespace:
SystemAssembly: Walter (in Walter.dll)
Members
| Member name | Description | |
|---|---|---|
| SHA256 | The SHA256 method will be used generating a 64 character hash | |
| SHA384 | The SHA256 method will be used generating a 96 character hash | |
| SHA512 | The SHA512 method will be used generating a 128 character hash | |
| SHA1 | The SHA1 method will be used generating a 40 character hash |
Examples
Make a password from a string
var creditCard="4500-000-000-000"; var password= creditCard.AsShaHash(HashMethod.SHA256, 8); var encryptionHelper = new Walter.SymmetricEncryption(password); var cypher= encryptionHelper.EncryptString(plain); if(string.IsNullOrEmpty(cypher)) { throw new ApplicationException("Encryption generate null"); } var copy= encryptionHelper.DecryptString(cypher); if(!string.Equals(plain, copy, StringComparison.Ordinal)) { throw new Exception($"Plain {plain} and copy {copy} should be the same"); }

