uint[] ByteArrayToUIntArray(byte[] input, int offset)
{
int bytes = input.Length - offset;
int ints = bytes / 4;
uint[] output = new uint[ints];
int byidx = offset;
for (int i = 0; i < ints; i++)
{
uint n = (uint)(((int)input[byidx + 3] << 24) | ((int)input[byidx + 2] << 16) | ((int)input[byidx + 1] << 8) | ((int)input[byidx + 0]));
output[i] = n;
byidx += 4;
}
return output;
}