internal static bool IsValid <T>(ICrcConfig <T> item, out T current) where T : struct, IComparable, IFormattable { using var ms = new MemoryStream(new byte[] { 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39 }); item.ComputeHash(ms, out current); return(EqualityComparer <T> .Default.Equals(current, item.Check)); }
internal static void ThrowIfInvalid <T>(ICrcConfig <T> item) where T : struct, IComparable, IFormattable { if (item.IsValid(out var current)) return; }