private static uint GetWord(byte[] bytes, int start, int end) {
uint four = 0;
int bits = end - start;
int shift = 0;
if (bits > 32) {
bits = 32;
}
start /= 8;
while (bits > 0) {
uint value = bytes[start];
if (bits < 8) {
value &= (1u << bits) - 1u;
}
value <<= shift;
four |= value;
bits -= 8;
shift += 8;
start++;
}
return four;
}