Skip to content

Instantly share code, notes, and snippets.

@CJ42
Last active December 1, 2022 12:00
Show Gist options
  • Save CJ42/01ccb48bcbee928bd9ee8d522859f7fe to your computer and use it in GitHub Desktop.
Save CJ42/01ccb48bcbee928bd9ee8d522859f7fe to your computer and use it in GitHub Desktop.
Solidity Table that summarizes the equivalent number of bits / bytes to convert between signed / unsigned integer (`intN` / `uintN`) and `bytesN`

 bytesN / uintM table equivalence for Solidity

uintM bytesN
uint8 bytes1
uint16 bytes2
uint24 bytes3
uint32 bytes4
uint40 bytes5
uint48 bytes6
uint56 bytes7
uint64 bytes8
uint72 bytes9
uint80 bytes10
uint88 bytes11
uint96 bytes12
uint104 bytes13
uint112 bytes14
uint120 bytes15
uint128 bytes16
uint136 bytes17
uint144 bytes18
uint152 bytes19
uint160 bytes20
uint168 bytes21
uint176 bytes22
uint184 bytes23
uint192 bytes24
uint200 bytes25
uint208 bytes26
uint216 bytes27
uint224 bytes28
uint232 bytes29
uint240 bytes30
uint248 bytes31
uint256 bytes32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment