mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-27 22:22:32 +00:00
002d6e9c89
Fixed occasional TreeView flickering in Edit Things window, Browse Action window and Tag Explorer panel. Updated Thing category icons in the Edit Things window. They now have "opened" and "closed" states. Internal: added BufferedTreeView to the core controls. Updated ZDoom game configurations (sector crush mode). Updated ZDoom ACC.
28 lines
701 B
C#
28 lines
701 B
C#
using System.IO;
|
|
using System.Security.Cryptography;
|
|
using System.Text;
|
|
|
|
namespace CodeImp.DoomBuilder
|
|
{
|
|
public static class MD5Hash
|
|
{
|
|
private static MD5 hasher = MD5.Create();
|
|
|
|
public static string Get(Stream stream)
|
|
{
|
|
// Check hash
|
|
byte[] data = hasher.ComputeHash(stream);
|
|
|
|
// Rewind the stream
|
|
stream.Position = 0;
|
|
|
|
// Create a new Stringbuilder to collect the bytes and create a string.
|
|
StringBuilder hash = new StringBuilder();
|
|
|
|
// Loop through each byte of the hashed data and format each one as a hexadecimal string.
|
|
for(int i = 0; i < data.Length; i++) hash.Append(data[i].ToString("x2"));
|
|
|
|
return hash.ToString();
|
|
}
|
|
}
|
|
}
|