SHA1() public static méthode

Gets SHA1 hash of a byte array
public static SHA1 ( byte buffer ) : string
buffer byte Byte array
Résultat string
Exemple #1
0
        /// <summary>
        /// Gets SHA1 hash of a string
        /// </summary>
        /// <param name="str">String</param>
        /// <returns>SHA1 hash as string</returns>
        public static string SHA1(string str)
        {
#if SILVERLIGHT
            byte[] bytes = Encoding.UTF8.GetBytes(str);
#else
            byte[] bytes = ASCIIEncoding.Default.GetBytes(str);
#endif
            return(ByteUtility.SHA1(bytes));
        }
Exemple #2
0
 /// <summary>
 /// Gets SHA1 hash of a string
 /// </summary>
 /// <param name="str">String</param>
 /// <returns>SHA1 hash as string</returns>
 public static string SHA1(string str)
 {
     byte[] bytes = ASCIIEncoding.Default.GetBytes(str);
     return(ByteUtility.SHA1(bytes));
 }