‘ASCII.GetString’ for values >127

Hello Everyone,

need help in understanding how can the ‘ASCII.GetString’ method work here when the array has elements >127.

How does this work?

————————–

byte[] array = new byte[32];

byte[] array2 = new byte[]

{ 245, 75, 65, 142, 68, 71, 100, 185, 74, 127, 62, 130, 231, 129, 254, 243, 28, 58, 103, 179, 60, 91, 195, 215, 102, 145, 154, 27, 57, 231, 241, 86 }; random.NextBytes(array); uint num = 0u; while ((ulong)num < (ulong)((long)array2.Length)) { byte[] array3 = array2; uint num2 = num; array3[(int)num2] = (array3[(int)num2] ^ array[(int)num]); num += 1u; } return Encoding.ASCII.GetString(array2); 

submitted by /u/clawesome_crab
[link] [comments]

Leave a Reply