Esempio n. 1
0
        public String SHA512CheckSum(string input_file)
        {
            if (!File.Exists(@input_file))
            {
                return(String.Empty);
            }
            SHA512        sha = SHA512.Create();
            StringBuilder sb  = new StringBuilder();

            try
            {
                FileStream input_f   = File.OpenRead(input_file);
                byte[]     out_bytes = sha.ComputeHash(input_f);

                foreach (byte o in out_bytes)
                {
                    sb.Append(o.ToString("x2"));
                }
                sha.Clear();
                input_f.Close();
            }
            catch { return(String.Empty); }

            return(sb.ToString());
        }
Esempio n. 2
0
 public void Dispose()
 {
     _sha512.Clear();
     _sha512.Dispose();
 }