←———————————————————1bytes ————————————————————>
←————————1 hex ——————————>←——————— 1 hex ——————————>
[ ] b i t
[ ] b i t
[ ] b i t
[ ] b i t
[ ] b i t
[ ] b i t
[ ] b i t
[ ] b i t
hex > 16base = (2^4)
uint16 = (max)2^16 = (2^4)^4) = hex ^ 4
uint32 = (max)2^32 = (2^4)^8) = hex ^ 8
1bytes = 2 hex = 8bit(1bytes = bytesの長さが1個だよ)
uint32 a = 0x12345678;
uint16 b = uint16(a); // b = 0x5678
uint16 a = 0x1234;
uint32 b = uint32(a); // b = 0x**0000**1234
bytes2 a = 0x1234;
bytes1 b = bytes1(a); // b = 0x12
bytes2 a = 0x1234;
bytes4 b = bytes4(a); // b = 0x12340000
bytes2 a = 0x1234;
uint32 b = uint16(a); // b = 0x00001234
uint32 c = uint32(bytes4(a)); // c = 0x12340000 1bytes = 8bit
uint8 d = uint8(uint16(a)); // d = 0x34
uint8 e = uint8(bytes1(a)); // e = 0x12
bool = 8bits = 1bytes