Answers for "c# sha1"

1

sha-1 in C#

static string Hash(string input)
{
    using (SHA1Managed sha1 = new SHA1Managed())
    {
        var hash = sha1.ComputeHash(Encoding.UTF8.GetBytes(input));
        var sb = new StringBuilder(hash.Length * 2);

        foreach (byte b in hash)
        {
            // can be "x2" if you want lowercase
            sb.Append(b.ToString("X2"));
        }

        return sb.ToString();
    }
}
Posted by: Guest on December-10-2020
0

c# sha1

Search "c# sha1 password example" for example(s).
Posted by: Guest on July-16-2021

Browse Popular Code Answers by Language