A Adam Durity Jul 18, 2003 #1 Anyone have a good example of how to use the MD5 encoding provider class that comes as part of the System.Security namespace? -ALD
Anyone have a good example of how to use the MD5 encoding provider class that comes as part of the System.Security namespace? -ALD
A Austin Ehlers Jul 18, 2003 #2 Anyone have a good example of how to use the MD5 encoding provider class that comes as part of the System.Security namespace? -ALD Click to expand... And here is how to use it on files: StringBuilder sb=new StringBuilder(); FileStream fs=new FileStream("filename",FileMode.Open); BinaryReader br=new BinaryReader(fs); MD5 md5=new MD5CryptoServiceProvider(); byte[] hash=md5.ComputeHash(br.BaseStream); foreach (byte hex in hash) sb.Add(hex.ToString("x2")); //convert to standard MD5 form fs.Close();
Anyone have a good example of how to use the MD5 encoding provider class that comes as part of the System.Security namespace? -ALD Click to expand... And here is how to use it on files: StringBuilder sb=new StringBuilder(); FileStream fs=new FileStream("filename",FileMode.Open); BinaryReader br=new BinaryReader(fs); MD5 md5=new MD5CryptoServiceProvider(); byte[] hash=md5.ComputeHash(br.BaseStream); foreach (byte hex in hash) sb.Add(hex.ToString("x2")); //convert to standard MD5 form fs.Close();