Quantcast
Channel: How to salt and hash a password value using c#? - Stack Overflow
Viewing all articles
Browse latest Browse all 7

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

$
0
0

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 all articles
Browse latest Browse all 7

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>