Quantcast
Viewing latest article 1
Browse Latest Browse All 7

Answer by magnus for How to salt and hash a password value using c#?

Simple hash:

public string GetSHA256Hash(string s)        {            if (string.IsNullOrEmpty(s))            {                throw new ArgumentException("An empty string value cannot be hashed.");            }            Byte[] data = System.Text.Encoding.UTF8.GetBytes(s);            Byte[] hash = new SHA256CryptoServiceProvider().ComputeHash(data);            return Convert.ToBase64String(hash);        }

Viewing latest article 1
Browse Latest Browse All 7

Trending Articles