type:
integration
supports-foxycart-version-from:
0.7.2
system:
ASP.Net, C#
name:
SSO Helper code for ASP.net/cSharp
description:
Includes code for hashing with SHA1
tags:
cSharp, .net, asp, sso

C# SSO Helpers

Please note: The code on this page is submitted by members of the FoxyCart community, and may not verified by FoxyCart.com LLC in any way, shape, or form. Please double check the code before installing. If you need help with it please post in our forum, but if we cannot offer assistance (due to unfamiliarity with this particular system or language) we apologize in advance.

SHA1 Hashing

private string ComputeHash(string token)
{
    SHA1 sha1 = SHA1.Create();
    byte[] hashData = sha1.ComputeHash(Encoding.UTF8.GetBytes(token));
    StringBuilder returnValue = new StringBuilder();
    for (int i = 0; i < hashData.Length; i++)
    {
        returnValue.Append(hashData.ToString("x2"));
    }
    return returnValue.ToString();
}

Site Tools