using DTLib.Filesystem; using System.Collections.Generic; using System.Security.Cryptography; namespace DTLib { // // хеширует массивы байтов алшоритмом SHA256 и файлы алгоримом XXHash32 // public class Hasher { readonly HashAlgorithm sha256 = SHA256.Create(); readonly HashAlgorithm xxh32 = XXHash32.Create(); public Hasher() { } // хеш массива public byte[] Hash(byte[] input) => sha256.ComputeHash(input); // хеш из двух массивов public byte[] Hash(byte[] input, byte[] salt) { var rez = new List(); rez.AddRange(input); rez.AddRange(salt); return sha256.ComputeHash(rez.ToArray()); } // хеш двух массивов зацикленный public byte[] HashCycled(byte[] input, byte[] salt, ushort cycles) { for(uint i = 0; i