コード例 #1
0
ファイル: ChecksumExtensions.cs プロジェクト: ellen50/gsf
        /// <summary>Calculates quad-word length (64-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 over.</param>
        /// <returns>Quad-word length XOR check-sum.</returns>
        public static ulong Xor64Checksum(this byte[] data, int startIndex, int length)
        {
            Xor64 checksum = new Xor64();

            checksum.Update(data, startIndex, length);

            return(checksum.Value);
        }
コード例 #2
0
ファイル: ChecksumExtensions.cs プロジェクト: rmc00/gsf
        /// <summary>Calculates quad-word length (64-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 over.</param>
        /// <returns>Quad-word length XOR check-sum.</returns>
        public static ulong Xor64Checksum(this byte[] data, int startIndex, int length)
        {
            Xor64 checksum = new Xor64();

            checksum.Update(data, startIndex, length);

            return checksum.Value;
        }