11100 << 2 == 28 * 2 * 2
11100 >> 2 == 28 / 2 / 2
bit to byte == bit >> 3
x mod 64 == x & 0x3F
从本机字次序转换成小端
unsigned int i, j;
for (i = 0, j = 0; j < len; i++, j += 4) {
output[j] = (byte)(input[i] & 0xff);
output[j+1] = (byte)((input[i] >> 8) & 0xff);
output[j+2] = (byte)((input[i] >> 16) & 0xff);
output[j+3] = (byte)((input[i] >> 24) & 0xff);
}
从小端转换成本机字次序
unsigned int i, j;
for (i = 0, j = 0; j < len; i++, j += 4)
output[i] = ((uint32)input[j]) | (((uint32)input[j+1]) << 8) |
(((uint32)input[j+2]) << 16) | (((uint32)input[j+3]) << 24);