/// <summary> /// Creates a new <see cref="ICRC" /> instance with given configuration. /// </summary> /// <param name="config">The configuration to use.</param> /// <returns> /// A <see cref="ICRC" /> instance. /// </returns> public ICRC Create(ICRCConfig config) { if (config == null) { throw new ArgumentNullException(nameof(config)); } return(new CRC_Implementation(config)); }
public static byte[] CalculateCRC(byte[] data, ICRCConfig checksumType) { var function = CRCFactory.Instance.Create(checksumType); IHashValue value = function.ComputeHash(data); return value.Hash; }
public static byte[] GetCRC(byte[] value, ICRCConfig crcConfig) { return(CRCFactory.Instance.Create(crcConfig).ComputeHash(value).Hash); }