hippiewho
❔ Compare Enum Values with submitted value
Actually you got me thinking and so i just tested this out. I was wrong, you would need to make the values of the enum into powers of 2. By default enums are start at 0 get assigned a value +1 greater than the previous. Has flag only works correctly if the values are non zero and power of two. The flags attribute can enforce that rule but HasFlag is part of the enum type and can be used (incorrectly) when the enum is not power of 2
75 replies
❔ Compare Enum Values with submitted value
The has flag works rgardless because at its core its a bitwise check (IIRC). The flags attribute markes the enum as a powers of 2 flag (under the hood it uses binary flags - 0001, 0010, 0100, 1000, etc)
75 replies
CryptoStream decrypt encrypt
I read this as well... And it does seem to be a padding issue but none of the padding options work... I changed it up a bit and i was able to get the decrypt method to decrypt most of the string.... The last few bits are missing. I ended up adding a few characters to the rawValue string and it decrypted the entire string correctly (with the padding characters I added).
Still so lost
8 replies