Skip to Content
Mastering Blockchain Programming with Solidity
book

Mastering Blockchain Programming with Solidity

by Jitendra Chittoda
August 2019
Intermediate to advanced
486 pages
13h 52m
English
Packt Publishing
Content preview from Mastering Blockchain Programming with Solidity

Fixed size byte arrays

A fixed size array means the array that does not grow or shrink in terms of its capacity. Solidity supports the byte data type that represents a value of a byte (8 bits). There are some predefined byte arrays data types readily available in Solidity: bytes1, bytes2, and so on, up to bytes32 (stepping 1). Each of these is a byte[] arrays type; for example, bytes2 is a byte[2] array of size 2, bytes3 is a byte[3] array of size 3, and so on for bytes32 is a byte[32] array of size 32. bytes1 is a special one, as it is an alias of byte.

As each of bytes1...bytes32 is an array of byte[], their values are accessible with the index. For example, if there is a variable, b, which is of the bytesN type, then b[k] returns the  ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Ethereum

Mastering Ethereum

Andreas M. Antonopoulos, Gavin Wood
Complete Cryptocurrency and Blockchain Course | Learn Solidity

Complete Cryptocurrency and Blockchain Course | Learn Solidity

Ravinder Deol, Codestars By Rob Percival, Thomas Wiesner

Publisher Resources

ISBN: 9781839218262Supplemental Content