SHA1CryptoServiceProvider sha1 = new SHA1CryptoServiceProvider();
byte[] str1 = System.Text.Encoding.UTF8.GetBytes(str);
byte[] hash = sha1.ComputeHash(str1);
sha1.Clear();
(sha1 as IDisposable).Dispose();