Generate the hash code of the password : SHA1Managed : Security C# Examples


C# Examples » Security » SHA1Managed »

 

Generate the hash code of the password









    
using  System;
using  System.Text;
using  System.Security.Cryptography;

class  MainClass
{
        public  static  void  Main(string[]  args)
        {
                HashAlgorithm  hashAlg  =  new  SHA1Managed();

                using  (hashAlg)
                {
                        byte[]  pwordData  =  Encoding.Default.GetBytes("password");

                        byte[]  hash  =  hashAlg.ComputeHash(pwordData);

                        Console.WriteLine(BitConverter.ToString(hash));
                }
        }
}
    
   
  
   



Output

5B-AA-61-E4-C9-B9-3F-3F-06-82-25-0B-6C-F8-33-1B-7E-E6-8F-D8


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Security
» SHA1Managed