CSharpTest.Net
Add(Byte) Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.IO Namespace > Crc64 Structure > Add Method : Add(Byte) Method

b

Glossary Item Box

Adds a byte to the checksum

Syntax

Visual Basic (Declaration) 
Public Overloads Sub Add( _
   ByVal b As Byte _
) 
C# 
public void Add( 
   byte b
)

Parameters

b

Example

Library/Library.Test/TestCrc64.cs

C#Copy Code
Crc64 crc = new Crc64();
Assert.AreEqual(0, crc.Value);
Assert.AreEqual(0, crc.GetHashCode());

crc.Add(0x1b);

Assert.AreNotEqual(0, crc.Value);
Assert.AreEqual((int)crc.Value ^ (int)(crc.Value >> 32), crc.GetHashCode());
VB.NETCopy Code
Dim crc As New Crc64()
Assert.AreEqual(0, crc.Value)
Assert.AreEqual(0, crc.GetHashCode())

crc.Add(&H1b)

Assert.AreNotEqual(0, crc.Value)
Assert.AreEqual(DirectCast(crc.Value, Integer) Xor DirectCast((crc.Value >> 32), Integer), crc.GetHashCode())

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys