View BMPartialPatternSearch.cs
public class BMPartialPatternSearch
{
public int MinimumSearchLength;
public BMPartialPatternSearch(int min = 5)
{
MinimumSearchLength = min;
}
public(byte[] partialPattern, int idx) SearchPartial(byte[] pattern, byte[] searchArray)
{
var bm = new BoyerMoore(pattern);
View SmallHashSet.cs
public class SmallHashSet<T>
{
private int[] _hashBuckets;
private uint _hashCode;
public Data[] Datas;
public SmallHashSet() : this(4096)
{
}
public SmallHashSet(int size)
{
View TextBinaryFileId.cs
public class TextBinaryFileId
{
private readonly BoyerMoore _boyerMoore4Null = new BoyerMoore(new byte[] {0, 0, 0, 0});
public Dictionary<string, string> BinaryFiles = new Dictionary<string, string>();
public Dictionary<string, Encoding> EncodingFiles = new Dictionary<string, Encoding>();
public Dictionary<string, double> TextFiles = new Dictionary<string, double>();
public bool IsBlockText(byte[] BinData, double ConfidenceThreshold = 25)
{
if(BinData.Length == 0)
return false;
View ProgressReport.cs
public class ProgressReport
{
public readonly Dictionary<string, object> GValues = new Dictionary<string, object>();
public List<string> ErrorLog = new List<string>();
public void Set(string name, object value)
{
if(!GValues.ContainsKey(name))
GValues.Add(name, value);
else GValues[name] = value;
}
View UniHashStatic.cs
[Serializable]
public static class UniHashStatic
{
private static readonly FNV1a64 _hash64;
private static readonly Sha3 _hash1600;
private static readonly Murmur3 _hash128;
private static readonly SHA256Managed _hash256;
private static readonly SHA512Managed _hash512;
static UniHashStatic()
{
View TBuffer.cs
public class TBuffer<T>
{
private readonly int _size;
private Murmur3.Result[] _hashes;
private bool _hashesUpToDate;
public T[] Things;
public TBuffer(int size)
{
_size = size;
Things = new T[size];
View CustomGroupBox.cs
public class CustomGroupBox : Panel
{
public enum BorderStyles
{
GroupBox = 0,
Panel
}
public enum HeaderMode
{
None = 0,
View GetProcessorInfo.cs
private static Dictionary<string, string> GetProcessorInfo()
{
ManagementObjectCollection moc;
var Processor = new Dictionary<string, string>();
try
{
moc = new ManagementObjectSearcher("select * from Win32_Processor").Get();
}
catch
View CalculateThisPCGFLOPS.cs
public static double CalculateThisPCGFLOPS()
{
const int Flops = 10_000_000;
const int Loops = 10;
var etl = new List<double>();
var random = new Random();
var begE1 = Enumerable.Range(0, Flops).AsParallel().WithDegreeOfParallelism(Environment.ProcessorCount).Select(i => random.NextDouble()).ToArray();
var mulE1 = Enumerable.Range(0, Flops).AsParallel().WithDegreeOfParallelism(Environment.ProcessorCount).Select(i => random.NextDouble()).ToArray();
for(var loop = 0; loop < Loops; ++loop)
{
View SmartI.cs
public class SmartI
{
private readonly Dictionary<int, Smart> _smartInfo = new Dictionary<int, Smart>();
public readonly HashSet<int> FutureReserchUnknownAttributes = new HashSet<int>();
private static bool Is64Bit => IntPtr.Size == 8;
private static uint OffsetSize => Is64Bit ? 8u : 6u;
public Dictionary<int, Smart> SmartInfo
{
get
{