EVMC
evmc::bytes32 Struct Reference

The fixed size array of 32 bytes for storing 256-bit EVM values. More...

#include <evmc.hpp>

Inherits evmc_bytes32.

Public Member Functions

constexpr bytes32 (evmc_bytes32 init={}) noexcept
 Default and converting constructor. More...
 
constexpr bytes32 (uint64_t v) noexcept
 Converting constructor from unsigned integer value. More...
 
constexpr operator bool () const noexcept
 Explicit operator converting to bool.
 

Additional Inherited Members

- Public Attributes inherited from evmc_bytes32
uint8_t bytes [32]
 The 32 bytes.
 

Detailed Description

The fixed size array of 32 bytes for storing 256-bit EVM values.

This type wraps C evmc_bytes32 to make sure objects of this type are always initialized.

Definition at line 66 of file evmc.hpp.

Constructor & Destructor Documentation

◆ bytes32() [1/2]

constexpr evmc::bytes32::bytes32 ( evmc_bytes32  init = {})
inlineconstexprnoexcept

Default and converting constructor.

Initializes bytes to zeros if not other init value provided.

Definition at line 71 of file evmc.hpp.

71 {}) noexcept : evmc_bytes32{init} {}
The fixed size array of 32 bytes.
Definition: evmc.h:57

◆ bytes32() [2/2]

constexpr evmc::bytes32::bytes32 ( uint64_t  v)
inlineexplicitconstexprnoexcept

Converting constructor from unsigned integer value.

This constructor assigns the v value to the last 8 bytes [24:31] in big-endian order.

Definition at line 77 of file evmc.hpp.

78  : evmc_bytes32{{0,
79  0,
80  0,
81  0,
82  0,
83  0,
84  0,
85  0,
86  0,
87  0,
88  0,
89  0,
90  0,
91  0,
92  0,
93  0,
94  0,
95  0,
96  0,
97  0,
98  0,
99  0,
100  0,
101  0,
102  static_cast<uint8_t>(v >> 56),
103  static_cast<uint8_t>(v >> 48),
104  static_cast<uint8_t>(v >> 40),
105  static_cast<uint8_t>(v >> 32),
106  static_cast<uint8_t>(v >> 24),
107  static_cast<uint8_t>(v >> 16),
108  static_cast<uint8_t>(v >> 8),
109  static_cast<uint8_t>(v >> 0)}}
110  {}

The documentation for this struct was generated from the following file: