Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ FillNonZeroBytes() [2/2]

static void System.Security.Cryptography.RsaPaddingProcessor.FillNonZeroBytes ( Span< byte > data)
inlinestaticprivate

Definition at line 194 of file RsaPaddingProcessor.cs.

195 {
196 while (data.Length > 0)
197 {
198 RandomNumberGenerator.Fill(data);
199 int num = data.Length;
200 for (int i = 0; i < data.Length; i++)
201 {
202 if (data[i] == 0)
203 {
204 num = i;
205 break;
206 }
207 }
208 for (int j = num + 1; j < data.Length; j++)
209 {
210 if (data[j] != 0)
211 {
212 data[num++] = data[j];
213 }
214 }
215 data = data.Slice(num);
216 }
217 }
Span< T > Slice(int start)
Definition Span.cs:271
int Length
Definition Span.cs:70

References System.Security.Cryptography.RandomNumberGenerator.Fill(), System.Span< T >.Length, and System.Span< T >.Slice().