Library/Library.Test/TestSalt.cs
C# | Copy Code |
---|---|
Salt s = new Salt(Salt.Size.b64); byte[] testData = new byte[8]; byte[] test1 = new SaltedData(s, testData).ToArray(); Assert.AreEqual(16, test1.Length); byte[] test2 = IOStream.ReadAllBytes(new SaltedData(s, testData).ToStream()); Assert.AreEqual(16, test2.Length); byte[] test3 = IOStream.ReadAllBytes(SaltedData.CombineStream(s, new MemoryStream(testData))); Assert.AreEqual(16, test3.Length); Assert.AreEqual(test1, test2); Assert.AreEqual(test1, test3); Assert.AreEqual(test2, test3); |
VB.NET | Copy Code |
---|---|
Dim s As New Salt(Salt.Size.b64) Dim testData As Byte() = New Byte(8) {} Dim test1 As Byte() = New SaltedData(s, testData).ToArray() Assert.AreEqual(16, test1.Length) Dim test2 As Byte() = IOStream.ReadAllBytes(New SaltedData(s, testData).ToStream()) Assert.AreEqual(16, test2.Length) Dim test3 As Byte() = IOStream.ReadAllBytes(SaltedData.CombineStream(s, New MemoryStream(testData))) Assert.AreEqual(16, test3.Length) Assert.AreEqual(test1, test2) Assert.AreEqual(test1, test3) Assert.AreEqual(test2, test3) |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7