2021-09-27 12:42:46 +00:00
|
|
|
using System.IO;
|
|
|
|
using System.Threading;
|
|
|
|
using System.Threading.Tasks;
|
2021-10-21 03:18:15 +00:00
|
|
|
using Wabbajack.RateLimiter;
|
2021-09-27 12:42:46 +00:00
|
|
|
|
2021-10-23 16:51:17 +00:00
|
|
|
namespace Wabbajack.Hashing.xxHash64;
|
|
|
|
|
|
|
|
public static class ByteArrayExtensions
|
2021-09-27 12:42:46 +00:00
|
|
|
{
|
2022-10-07 20:53:55 +00:00
|
|
|
public static async ValueTask<Hash> Hash(this byte[] data, IJob? job = null)
|
2021-09-27 12:42:46 +00:00
|
|
|
{
|
2021-10-23 16:51:17 +00:00
|
|
|
return await new MemoryStream(data).HashingCopy(Stream.Null, CancellationToken.None, job);
|
2021-09-27 12:42:46 +00:00
|
|
|
}
|
|
|
|
}
|