How would I convert this into a loop and not to use the pointer.
byte[] InputBuffer = new byte[8];
unsafe {
fixed (byte* pInputBuffer = InputBuffer) {
((long*)pInputBuffer)[0] = value;
}
}
I am trying to use the code from this page: query string parameter obfuscation
BitConverter
call is much more readable and probably has no extra performance cost compared to the unsafe code (especially when taken in the context of all the crypto stuff that's going on in the answer to the other question). – Guizot