Unstable 1.1.14.0
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user