System.Security.Cryptography.RNGCryptoServiceProvider.RNGCryptoServiceProvider.GetNonZeroBytes C# (CSharp) Method

GetNonZeroBytes() public method

public GetNonZeroBytes ( byte data ) : void
data byte
return void
		public override void GetNonZeroBytes (byte[] data) 
		{
			if (data == null)
				throw new ArgumentNullException ("data");

        		byte[] random = new byte [data.Length * 2];
        		int i = 0;
        		// one pass should be enough but hey this is random ;-)
        		while (i < data.Length) {
                		_handle = RngGetBytes (_handle, random);
				Check ();
                		for (int j=0; j < random.Length; j++) {
                        		if (i == data.Length)
                                		break;
                        		if (random [j] != 0)
                                		data [i++] = random [j];
                		}
        		}
		}