AssemblyCSharp.FileHelper.GetMD5OfString C# (CSharp) Method

GetMD5OfString() public static method

public static GetMD5OfString ( string value, string seed = null ) : byte[]
value string
seed string
return byte[]
        public static byte[] GetMD5OfString(string value, string seed = null)
        {
            using (var md5 = MD5.Create())
            {
            if (string.IsNullOrEmpty(seed))
            {
                return md5.ComputeHash(Encoding.UTF8.GetBytes(value));
            }
            else
            {
                var bytes = Encoding.UTF8.GetBytes(seed);
                md5.TransformBlock(bytes, 0, bytes.Length, bytes, 0);

                bytes = Encoding.UTF8.GetBytes(value);
                md5.TransformBlock(bytes, 0, bytes.Length, bytes, 0);
                md5.TransformFinalBlock(bytes, 0, 0);
                return md5.Hash;
            }
            }
        }