cheeze2000
Trying to understand required members
I can't seem to set the value of a required member through a subclass's constructor.
https://dotnetfiddle.net/Gz6b7M
Any help is appreciated.
16 replies
Creating a function that accepts either string or byte[]
i have some function that is supposed to perform AES 256 encryption,
EncryptAes(byte[] plaintext, byte[] key)
the problem is i want this function to accept either string
or byte[]
but then i have to declare 3 other function overloads. So my approach was something like EncryptAes(EncryptionInput plaintext, EncryptionInput key)
and then a bunch of public static implicit operator
s.
is this a good approach?4 replies
Help me with my concurrency experiments
Correct me if I'm wrong. Based on my understanding, a CPU with 1 core running 1 thread has the same computing power as another CPU with 1 core running 2 threads. The latter will handle 2 tasks but each task will roughly have half of the computing power. Is there anything in C# I can do to simulate this? Perhaps a function that exits after a certain amount of CPU cycles.
4 replies