我正在尝试根据C/C++中的RFC1321实现MD5算法,并且在类型转换方面存在一些问题.
typedef unsigned int uint4; // 32 Bit (4 Byte)
typedef unsigned char uint1; // 8 Bit (1 Byte)
// pseudocode
uint1 byte = {1,0,0,1,1,1,1,0}; // 0b10011110
uint4 t_uint4 = (uint4)byte;
uint4 = { ??? }
// maybe like this??
uint4 = { {1,0,0,1,1,1,1,0},{???},{???},{???} }
uint4 = { {???},{???},{???},{1,0,0,1,1,1,1,0} }
Run Code Online (Sandbox Code Playgroud)
那么在将1Byte变量转换为4Byte变量时,或者将unsigned char转换为unsigned int时会发生什么?
| 归档时间: |
|
| 查看次数: |
114 次 |
| 最近记录: |