1。32位数据转换为8位数据
UINT32 m_num32[512];//32里面有参数
UINT8 m_num8[2048];
UINT8 m_temp;
memset(m_num8, 0, 2048);
for(int i = 0; i < 512; i++)
{
m_temp = m_num32[i] >> 24;
m_num8[i] = m_temp;
m_temp = m_num32[i] >> 16;
m_num8[i + 512] = m_temp;
m_temp = m_num32[i] >> 8;
m_num8[i + 1024] = m_temp;
m_temp = m_num32[i];
m_num8[i + 1536] = m_temp;
}
2.8位数据转换位32位数据
UINT32 m_num32[512];
UINT8 m_num8[2048];//8里面有数据
UINT8 m_temp;
memset(m_num32, 0, 512);
for(int i = 0; i < 512; i++)
{
m_temp = m_num8[i];
m_num32[i] |= m_temp << 24;
m_temp = m_num8[i + 512];
m_num32[i] |= m_temp << 16;
m_temp = m_num8[i + 1024];
m_num32[i] |= m_temp << 8;
m_temp = m_num8[i + 1536];
m_num32[i] |= m_temp;
}