Unstable 1.1.14.0

This commit is contained in:
Markus Isberg
2023-10-02 16:43:54 +03:00
parent 94f5a93a0c
commit cf8f0de659
606 changed files with 21906 additions and 11456 deletions
@@ -2,6 +2,7 @@
using Barotrauma.IO;
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
@@ -98,6 +99,16 @@ namespace Barotrauma
return new Md5Hash(hash);
}
public static Md5Hash MergeHashes(IEnumerable<Md5Hash> hashes)
{
using IncrementalHash incrementalHash = IncrementalHash.CreateHash(HashAlgorithmName.MD5);
foreach (var hash in hashes)
{
incrementalHash.AppendData(hash.ByteRepresentation);
}
return BytesAsHash(incrementalHash.GetHashAndReset());
}
public static Md5Hash CalculateForBytes(byte[] bytes)
{
return new Md5Hash(bytes, calculate: true);