CSharpTest.Net
CreateBytes(Size) Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Crypto Namespace > Salt Class > CreateBytes Method : CreateBytes(Size) Method

szBits

Glossary Item Box

Creates n bytes of data usable as a salt

Syntax

Visual Basic (Declaration) 
Public Overloads Shared Function CreateBytes( _
   ByVal szBits As Salt.Size _
) As Byte()
C# 
public static byte[] CreateBytes( 
   Salt.Size szBits
)

Parameters

szBits

Example

Library/Library.Test/TestSalt.cs

C#Copy Code
byte[] test = new byte[16];
Assert.AreEqual(new byte[16], test);
Salt.CreateBytes(test);
Assert.AreNotEqual(new byte[16], test);
Assert.AreNotEqual(Salt.CreateBytes(Salt.Size.b128), test);
VB.NETCopy Code
Dim test As Byte() = New Byte(16) {}
Assert.AreEqual(New Byte(16) {}, test)
Salt.CreateBytes(test)
Assert.AreNotEqual(New Byte(16) {}, test)
Assert.AreNotEqual(Salt.CreateBytes(Salt.Size.b128), test)

Requirements

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

See Also

Generated with Document! X 2011 by Innovasys