MD5() public static method

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