Update() public method

Updates the checksum with an array of bytes.
public Update ( byte buffer ) : void
buffer byte /// The source of the data to update with. ///
return void
コード例 #1
0
ファイル: ChecksumExtensions.cs プロジェクト: xj0229/gsf
        /// <summary>Calculates word length (16-bit) XOR-based check-sum on specified portion of a buffer.</summary>
        /// <param name="data">Data buffer to perform XOR check-sum on.</param>
        /// <param name="startIndex">Starts index in data buffer to begin XOR check-sum.</param>
        /// <param name="length">Total number of bytes from <paramref name="startIndex">startIndex</paramref> to
        /// perform XOR check-sum overs</param>
        /// <returns>Word length XOR check-sum.</returns>
        public static ushort Xor16CheckSum(this byte[] data, int startIndex, int length)
        {
            Xor16 checksum = new Xor16();

            checksum.Update(data, startIndex, length);

            return(checksum.Value);
        }
コード例 #2
0
ファイル: ChecksumExtensions.cs プロジェクト: rmc00/gsf
        /// <summary>Calculates word length (16-bit) XOR-based check-sum on specified portion of a buffer.</summary>
        /// <param name="data">Data buffer to perform XOR check-sum on.</param>
        /// <param name="startIndex">Starts index in data buffer to begin XOR check-sum.</param>
        /// <param name="length">Total number of bytes from <paramref name="startIndex">startIndex</paramref> to
        /// perform XOR check-sum overs</param>
        /// <returns>Word length XOR check-sum.</returns>
        public static ushort Xor16CheckSum(this byte[] data, int startIndex, int length)
        {
            Xor16 checksum = new Xor16();

            checksum.Update(data, startIndex, length);

            return checksum.Value;
        }