Php vs C#

SHA1 hash calculation in C#

public static string CalculateSHA1(string text, Encoding enc)
{
byte[] buffer = enc.GetBytes(text);
SHA1CryptoServiceProvider cryptoTransformSHA1 =
new SHA1CryptoServiceProvider();
string hash = BitConverter.ToString(
cryptoTransformSHA1.ComputeHash(buffer)).Replace(“-”, “”);

return hash;
}

SHA1 hash calculation in Php

sha1(“”)

Related posts:

  1. TurkishDecimalFormat
  2. EJB3 sample demo with Ajax
  3. A trojan horse

One thought on “Php vs C#

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>