Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am generating checksum file using SHA 256 Algorithm. But I need to update using HMAC SHA 256 Algorithm.

What I have tried:

Currently we are doing the same using SHA 256 AS BELOW:
public string GetChecksum(string strValue)
      {
          string strSHA256TOString = string.Empty;
          //Modified to windows - 1256 29-04-2012
          //byte[] bBytes = Encoding.UTF8.GetBytes(strValue);
          byte[] bBytes = Encoding.GetEncoding("windows-1256").GetBytes(strValue);
          var sha = new SHA256Managed();

          byte[] bChecksum = sha.ComputeHash(bBytes);
          strSHA256TOString = BitConverter.ToString(bChecksum).Replace("-", String.Empty);
          return strSHA256TOString.ToLower();
      }
Posted
Updated 16-May-19 20:18pm

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900