51 - Bytes Arrays
Fixed-size Byte Arrays: The value types bytes1, bytes2, bytes3, …, bytes32
hold a sequence of bytes from one to up to 32. The type byte[]
is an array of bytes, but due to padding rules, it wastes 31 bytes of space for each element (except in storage). It is better to use the bytes
type instead.
- Fixed-size Byte Arrays
bytes1
,bytes2..bytes32
- bytes vs. byte[] -> Wastage
- bytes -> Byte Storage
- E.g. Hashes