C
C#2y ago
SWEETPONY

✅ How to fill JObject?

I have following: var payload = new JObject{}; I'd like to fill this payload with random data and payload should be > 1mb what should I do?
3 Replies
SWEETPONY
SWEETPONYOP2y ago
what is the easiest way to fill array? oh! what about..
var payload = new JObject{new byte[1024*1024]};
var payload = new JObject{new byte[1024*1024]};
mindhardt
mindhardt2y ago
This will fill it with empty data If you wish to make fake but looks-like real data then consider using faker libraries, such as Bogus
SWEETPONY
SWEETPONYOP2y ago
didn't know about that, thanks! is it correct?
var payload = new JObject{GetByteArray()};

private byte[] GetByteArray()
{
var rnd = new Random();
var bytes = new byte[1024 * 1024];
rnd.NextBytes(bytes);

return bytes;
}
var payload = new JObject{GetByteArray()};

private byte[] GetByteArray()
{
var rnd = new Random();
var bytes = new byte[1024 * 1024];
rnd.NextBytes(bytes);

return bytes;
}
Want results from more Discord servers?
Add your server