C language conversion relationship with a different binary bytes (1 byte binary, hexadecimal)

Recently the team let me do the security authentication module (SAS), because it involves the field of algorithms, so closely related to the conversion of bytes, here I need to clear one byte, hexadecimal, binary relationship between, as follows shows:

∵ 1byte=8bit=128+64+32+16+8+4+2+1=255(无符号2进制)
∵ 1byte=OXFF=15*16^1+15*16^0=255(双16进制)
∴ 1byte=OXFF=8bit
∴ 1字节==双16进制数==8位无符号2进制数

Usually say this place  is generally refers to a unit of the binary, hexadecimal here so I did not use this unit, but only that is a two hexadecimal number, so as not to confuse the concept.

Published 352 original articles · won praise 390 · views 370 000 +

Guess you like

Origin blog.csdn.net/qq_19734597/article/details/100543663