> ## Documentation Index
> Fetch the complete documentation index at: https://voltaire.tevm.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# primitives/Bytes32

> Auto-generated API documentation

[**@tevm/voltaire**](../index.mdx)

***

[@tevm/voltaire](../index.mdx) / primitives/Bytes32

# primitives/Bytes32

Bytes32 - Fixed-size 32-byte array type

Generic 32-byte data structure used throughout Ethereum for various purposes
including storage values, contract data, and numeric representations.

## Classes

### InvalidBytes32HexError

Defined in: [src/primitives/Bytes32/errors.js:10](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/errors.js#L10)

Error thrown when Bytes32 hex format is invalid

#### Extends

* [`InvalidFormatError`](../index/index.mdx#invalidformaterror)

#### Constructors

##### Constructor

> **new InvalidBytes32HexError**(`message?`, `options?`): [`InvalidBytes32HexError`](#invalidbytes32hexerror)

Defined in: [src/primitives/Bytes32/errors.js:21](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/errors.js#L21)

###### Parameters

###### message?

`string`

Error message

###### options?

Error options

###### cause?

`Error`

Root cause error

###### code?

`string`

Error code

###### context?

`Record`\<`string`, `unknown`>

Additional context

###### docsPath?

`string`

Documentation path

###### expected?

`string`

Expected format

###### value?

`unknown`

Invalid value

###### Returns

[`InvalidBytes32HexError`](#invalidbytes32hexerror)

###### Overrides

[`InvalidFormatError`](../index/index.mdx#invalidformaterror).[`constructor`](../index/index.mdx#constructor-7)

#### Properties

##### cause?

> `optional` **cause**: `Error`

Defined in: [src/primitives/errors/AbstractError.ts:56](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L56)

Root cause of this error (for error chaining)

###### Inherited from

[`InvalidFormatError`](../index/index.mdx#invalidformaterror).[`cause`](../index/index.mdx#cause-7)

##### code

> **code**: `string`

Defined in: [src/primitives/errors/AbstractError.ts:39](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L39)

Machine-readable error code for programmatic handling

###### Example

```ts theme={null}
'INVALID_FORMAT', 'INVALID_LENGTH'
```

###### Inherited from

[`InvalidFormatError`](../index/index.mdx#invalidformaterror).[`code`](../index/index.mdx#code-7)

##### context?

> `optional` **context**: `Record`\<`string`, `unknown`>

Defined in: [src/primitives/errors/AbstractError.ts:45](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L45)

Additional context metadata for debugging

###### Example

```ts theme={null}
{ value: '0x123', expected: '20 bytes' }
```

###### Inherited from

[`InvalidFormatError`](../index/index.mdx#invalidformaterror).[`context`](../index/index.mdx#context-7)

##### docsPath?

> `optional` **docsPath**: `string`

Defined in: [src/primitives/errors/AbstractError.ts:51](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L51)

Path to documentation for this error

###### Example

```ts theme={null}
'/primitives/address/from-hex#error-handling'
```

###### Inherited from

[`InvalidFormatError`](../index/index.mdx#invalidformaterror).[`docsPath`](../index/index.mdx#docspath-7)

##### expected

> **expected**: `string`

Defined in: [src/primitives/errors/ValidationError.ts:19](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/ValidationError.ts#L19)

###### Inherited from

[`InvalidFormatError`](../index/index.mdx#invalidformaterror).[`expected`](../index/index.mdx#expected-3)

##### name

> **name**: `string`

Defined in: [src/primitives/Bytes32/errors.js:30](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/errors.js#L30)

###### Inherited from

`InvalidFormatError.name`

##### value

> **value**: `unknown`

Defined in: [src/primitives/errors/ValidationError.ts:18](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/ValidationError.ts#L18)

###### Inherited from

[`InvalidFormatError`](../index/index.mdx#invalidformaterror).[`value`](../index/index.mdx#value-3)

#### Methods

##### getErrorChain()

> **getErrorChain**(): `string`

Defined in: [src/primitives/errors/AbstractError.ts:94](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L94)

Get full error chain as string for logging

###### Returns

`string`

###### Inherited from

[`InvalidFormatError`](../index/index.mdx#invalidformaterror).[`getErrorChain`](../index/index.mdx#geterrorchain-14)

##### toJSON()

> **toJSON**(): `Record`\<`string`, `unknown`>

Defined in: [src/primitives/errors/AbstractError.ts:110](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L110)

Serialize error to JSON for logging/telemetry

###### Returns

`Record`\<`string`, `unknown`>

###### Inherited from

[`InvalidFormatError`](../index/index.mdx#invalidformaterror).[`toJSON`](../index/index.mdx#tojson-14)

***

### InvalidBytes32LengthError

Defined in: [src/primitives/Bytes32/errors.js:37](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/errors.js#L37)

Error thrown when Bytes32 has invalid length

#### Extends

* [`InvalidLengthError`](../index/index.mdx#invalidlengtherror)

#### Constructors

##### Constructor

> **new InvalidBytes32LengthError**(`message?`, `options?`): [`InvalidBytes32LengthError`](#invalidbytes32lengtherror)

Defined in: [src/primitives/Bytes32/errors.js:48](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/errors.js#L48)

###### Parameters

###### message?

`string`

Error message

###### options?

Error options

###### cause?

`Error`

Root cause error

###### code?

`string`

Error code

###### context?

`Record`\<`string`, `unknown`>

Additional context

###### docsPath?

`string`

Documentation path

###### expected?

`string`

Expected length

###### value?

`unknown`

Invalid value

###### Returns

[`InvalidBytes32LengthError`](#invalidbytes32lengtherror)

###### Overrides

[`InvalidLengthError`](../index/index.mdx#invalidlengtherror).[`constructor`](../index/index.mdx#constructor-8)

#### Properties

##### cause?

> `optional` **cause**: `Error`

Defined in: [src/primitives/errors/AbstractError.ts:56](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L56)

Root cause of this error (for error chaining)

###### Inherited from

[`InvalidLengthError`](../index/index.mdx#invalidlengtherror).[`cause`](../index/index.mdx#cause-8)

##### code

> **code**: `string`

Defined in: [src/primitives/errors/AbstractError.ts:39](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L39)

Machine-readable error code for programmatic handling

###### Example

```ts theme={null}
'INVALID_FORMAT', 'INVALID_LENGTH'
```

###### Inherited from

[`InvalidLengthError`](../index/index.mdx#invalidlengtherror).[`code`](../index/index.mdx#code-8)

##### context?

> `optional` **context**: `Record`\<`string`, `unknown`>

Defined in: [src/primitives/errors/AbstractError.ts:45](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L45)

Additional context metadata for debugging

###### Example

```ts theme={null}
{ value: '0x123', expected: '20 bytes' }
```

###### Inherited from

[`InvalidLengthError`](../index/index.mdx#invalidlengtherror).[`context`](../index/index.mdx#context-8)

##### docsPath?

> `optional` **docsPath**: `string`

Defined in: [src/primitives/errors/AbstractError.ts:51](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L51)

Path to documentation for this error

###### Example

```ts theme={null}
'/primitives/address/from-hex#error-handling'
```

###### Inherited from

[`InvalidLengthError`](../index/index.mdx#invalidlengtherror).[`docsPath`](../index/index.mdx#docspath-8)

##### expected

> **expected**: `string`

Defined in: [src/primitives/errors/ValidationError.ts:19](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/ValidationError.ts#L19)

###### Inherited from

[`InvalidLengthError`](../index/index.mdx#invalidlengtherror).[`expected`](../index/index.mdx#expected-4)

##### name

> **name**: `string`

Defined in: [src/primitives/Bytes32/errors.js:57](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/errors.js#L57)

###### Inherited from

`InvalidLengthError.name`

##### value

> **value**: `unknown`

Defined in: [src/primitives/errors/ValidationError.ts:18](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/ValidationError.ts#L18)

###### Inherited from

[`InvalidLengthError`](../index/index.mdx#invalidlengtherror).[`value`](../index/index.mdx#value-4)

#### Methods

##### getErrorChain()

> **getErrorChain**(): `string`

Defined in: [src/primitives/errors/AbstractError.ts:94](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L94)

Get full error chain as string for logging

###### Returns

`string`

###### Inherited from

[`InvalidLengthError`](../index/index.mdx#invalidlengtherror).[`getErrorChain`](../index/index.mdx#geterrorchain-16)

##### toJSON()

> **toJSON**(): `Record`\<`string`, `unknown`>

Defined in: [src/primitives/errors/AbstractError.ts:110](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L110)

Serialize error to JSON for logging/telemetry

###### Returns

`Record`\<`string`, `unknown`>

###### Inherited from

[`InvalidLengthError`](../index/index.mdx#invalidlengtherror).[`toJSON`](../index/index.mdx#tojson-16)

***

### InvalidBytes32ValueError

Defined in: [src/primitives/Bytes32/errors.js:64](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/errors.js#L64)

Error thrown when value is invalid for Bytes32

#### Extends

* [`ValidationError`](../index/index.mdx#validationerror)

#### Constructors

##### Constructor

> **new InvalidBytes32ValueError**(`message`, `options?`): [`InvalidBytes32ValueError`](#invalidbytes32valueerror)

Defined in: [src/primitives/Bytes32/errors.js:75](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/errors.js#L75)

###### Parameters

###### message

`string`

Error message

###### options?

Error options

###### cause?

`Error`

Root cause error

###### code?

`string`

Error code

###### context?

`Record`\<`string`, `unknown`>

Additional context

###### docsPath?

`string`

Documentation path

###### expected?

`string`

Expected value

###### value?

`unknown`

Invalid value

###### Returns

[`InvalidBytes32ValueError`](#invalidbytes32valueerror)

###### Overrides

[`ValidationError`](../index/index.mdx#validationerror).[`constructor`](../index/index.mdx#constructor-20)

#### Properties

##### cause?

> `optional` **cause**: `Error`

Defined in: [src/primitives/errors/AbstractError.ts:56](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L56)

Root cause of this error (for error chaining)

###### Inherited from

[`ValidationError`](../index/index.mdx#validationerror).[`cause`](../index/index.mdx#cause-19)

##### code

> **code**: `string`

Defined in: [src/primitives/errors/AbstractError.ts:39](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L39)

Machine-readable error code for programmatic handling

###### Example

```ts theme={null}
'INVALID_FORMAT', 'INVALID_LENGTH'
```

###### Inherited from

[`ValidationError`](../index/index.mdx#validationerror).[`code`](../index/index.mdx#code-19)

##### context?

> `optional` **context**: `Record`\<`string`, `unknown`>

Defined in: [src/primitives/errors/AbstractError.ts:45](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L45)

Additional context metadata for debugging

###### Example

```ts theme={null}
{ value: '0x123', expected: '20 bytes' }
```

###### Inherited from

[`ValidationError`](../index/index.mdx#validationerror).[`context`](../index/index.mdx#context-19)

##### docsPath?

> `optional` **docsPath**: `string`

Defined in: [src/primitives/errors/AbstractError.ts:51](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L51)

Path to documentation for this error

###### Example

```ts theme={null}
'/primitives/address/from-hex#error-handling'
```

###### Inherited from

[`ValidationError`](../index/index.mdx#validationerror).[`docsPath`](../index/index.mdx#docspath-19)

##### expected

> **expected**: `string`

Defined in: [src/primitives/errors/ValidationError.ts:19](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/ValidationError.ts#L19)

###### Inherited from

[`ValidationError`](../index/index.mdx#validationerror).[`expected`](../index/index.mdx#expected-7)

##### name

> **name**: `string`

Defined in: [src/primitives/Bytes32/errors.js:84](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/errors.js#L84)

###### Inherited from

`ValidationError.name`

##### value

> **value**: `unknown`

Defined in: [src/primitives/errors/ValidationError.ts:18](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/ValidationError.ts#L18)

###### Inherited from

[`ValidationError`](../index/index.mdx#validationerror).[`value`](../index/index.mdx#value-7)

#### Methods

##### getErrorChain()

> **getErrorChain**(): `string`

Defined in: [src/primitives/errors/AbstractError.ts:94](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L94)

Get full error chain as string for logging

###### Returns

`string`

###### Inherited from

[`ValidationError`](../index/index.mdx#validationerror).[`getErrorChain`](../index/index.mdx#geterrorchain-38)

##### toJSON()

> **toJSON**(): `Record`\<`string`, `unknown`>

Defined in: [src/primitives/errors/AbstractError.ts:110](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L110)

Serialize error to JSON for logging/telemetry

###### Returns

`Record`\<`string`, `unknown`>

###### Inherited from

[`ValidationError`](../index/index.mdx#validationerror).[`toJSON`](../index/index.mdx#tojson-38)

## Type Aliases

### Bytes32Like

> **Bytes32Like** = [`Bytes32Type`](#bytes32type) | `string` | `Uint8Array` | `bigint` | `number`

Defined in: [src/primitives/Bytes32/Bytes32Type.ts:18](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/Bytes32Type.ts#L18)

Inputs that can be converted to Bytes32

***

### Bytes32Type

> **Bytes32Type** = `Uint8Array` & `object`

Defined in: [src/primitives/Bytes32/Bytes32Type.ts:11](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/Bytes32Type.ts#L11)

Bytes32 - Fixed-size 32-byte array type

Generic 32-byte data structure used throughout Ethereum for various purposes
including storage values, contract data, and numeric representations.
While Hash is specifically for cryptographic hashes, Bytes32 is the general-purpose
32-byte type that can represent any 32-byte data.

#### Type Declaration

##### \[brand]

> `readonly` **\[brand]**: `"Bytes32"`

## Variables

### Bytes32

> `const` **Bytes32**: `object`

Defined in: [src/primitives/Bytes32/index.ts:87](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/index.ts#L87)

#### Type Declaration

##### bitwiseAnd()

> **bitwiseAnd**: (`a`, `b`) => [`Bytes32Type`](#bytes32type)

Perform bitwise AND on two Bytes32 values

###### Parameters

###### a

[`Bytes32Type`](#bytes32type)

First Bytes32

###### b

[`Bytes32Type`](#bytes32type)

Second Bytes32

###### Returns

[`Bytes32Type`](#bytes32type)

Result of a & b

###### Example

```typescript theme={null}
const result = Bytes32.bitwiseAnd(a, b);
```

##### bitwiseOr()

> **bitwiseOr**: (`a`, `b`) => [`Bytes32Type`](#bytes32type)

Perform bitwise OR on two Bytes32 values

###### Parameters

###### a

[`Bytes32Type`](#bytes32type)

First Bytes32

###### b

[`Bytes32Type`](#bytes32type)

Second Bytes32

###### Returns

[`Bytes32Type`](#bytes32type)

Result of a | b

###### Example

```typescript theme={null}
const result = Bytes32.bitwiseOr(a, b);
```

##### bitwiseXor()

> **bitwiseXor**: (`a`, `b`) => [`Bytes32Type`](#bytes32type)

Perform bitwise XOR on two Bytes32 values

###### Parameters

###### a

[`Bytes32Type`](#bytes32type)

First Bytes32

###### b

[`Bytes32Type`](#bytes32type)

Second Bytes32

###### Returns

[`Bytes32Type`](#bytes32type)

Result of a ^ b

###### Example

```typescript theme={null}
const result = Bytes32.bitwiseXor(a, b);
```

##### clone()

> **clone**: (`bytes32`) => [`Bytes32Type`](#bytes32type)

Create an independent copy of Bytes32

###### Parameters

###### bytes32

[`Bytes32Type`](#bytes32type)

Bytes32 to clone

###### Returns

[`Bytes32Type`](#bytes32type)

New Bytes32 with same values

###### Example

```typescript theme={null}
const copy = Bytes32.clone(original);
// Modifying copy won't affect original
```

##### compare()

> **compare**: (`a`, `b`) => `number`

Compare two Bytes32 values lexicographically

###### Parameters

###### a

[`Bytes32Type`](#bytes32type)

First Bytes32

###### b

[`Bytes32Type`](#bytes32type)

Second Bytes32

###### Returns

`number`

-1 if a \< b, 0 if equal, 1 if a > b

###### Example

```typescript theme={null}
const sorted = bytes32Array.sort(Bytes32.compare);
```

##### equals()

> **equals**: (`a`, `b`) => `boolean`

Check if two Bytes32 values are equal

###### Parameters

###### a

[`Bytes32Type`](#bytes32type)

First Bytes32

###### b

[`Bytes32Type`](#bytes32type)

Second Bytes32

###### Returns

`boolean`

True if equal

###### Example

```typescript theme={null}
if (Bytes32.equals(a, b)) {
  console.log("Values match");
}
```

##### from()

> **from**: (`value`) => [`Bytes32Type`](#bytes32type)

Create Bytes32 from various input types (universal constructor)

###### Parameters

###### value

Number, bigint, hex string, or Uint8Array

`string` | `number` | `bigint` | `Uint8Array`\<`ArrayBufferLike`>

###### Returns

[`Bytes32Type`](#bytes32type)

Bytes32

###### Throws

If value type is unsupported or invalid

###### Example

```typescript theme={null}
const b1 = Bytes32.from(42);                    // from number
const b2 = Bytes32.from(42n);                   // from bigint
const b3 = Bytes32.from('0x' + 'ab'.repeat(32)); // from hex
const b4 = Bytes32.from(new Uint8Array(32));    // from bytes
```

##### fromBigint()

> **fromBigint**: (`value`) => [`Bytes32Type`](#bytes32type)

Create Bytes32 from bigint (big-endian)

###### Parameters

###### value

`bigint`

Bigint to convert (must fit in 256 bits)

###### Returns

[`Bytes32Type`](#bytes32type)

Bytes32

###### Throws

If value is negative or exceeds 256 bits

###### Example

```typescript theme={null}
const b32 = Bytes32.fromBigint(0x123456789abcdef0n);
```

##### fromBytes()

> **fromBytes**: (`bytes`) => [`Bytes32Type`](#bytes32type)

Create Bytes32 from bytes. Input must be exactly 32 bytes.

###### Parameters

###### bytes

`Uint8Array`\<`ArrayBufferLike`>

Input bytes (must be 32 bytes)

###### Returns

[`Bytes32Type`](#bytes32type)

Bytes32

###### Throws

If bytes length is not 32

###### Example

```typescript theme={null}
const bytes = new Uint8Array(32);
bytes[0] = 1;
const b32 = Bytes32.fromBytes(bytes);
```

##### fromHex()

> **fromHex**: (`hex`) => [`Bytes32Type`](#bytes32type)

Create Bytes32 from hex string (with or without 0x prefix)

###### Parameters

###### hex

`string`

Hex string (64 chars, with or without 0x prefix)

###### Returns

[`Bytes32Type`](#bytes32type)

Bytes32

###### Throws

If hex length is not 64 characters

###### Throws

If hex contains invalid characters

###### Example

```typescript theme={null}
const b32 = Bytes32.fromHex('0x' + 'ab'.repeat(32));
const b32Alt = Bytes32.fromHex('ab'.repeat(32));
```

##### fromNumber()

> **fromNumber**: (`value`) => [`Bytes32Type`](#bytes32type)

Create Bytes32 from number (big-endian, zero-padded)

###### Parameters

###### value

`number`

Number to convert

###### Returns

[`Bytes32Type`](#bytes32type)

Bytes32

###### Example

```typescript theme={null}
const b32 = Bytes32.fromNumber(42);
// Last byte is 42, rest are zeros
```

##### isZero()

> **isZero**: (`bytes32`) => `boolean`

Check if Bytes32 is all zeros

###### Parameters

###### bytes32

[`Bytes32Type`](#bytes32type)

Bytes32 to check

###### Returns

`boolean`

True if all bytes are zero

###### Example

```typescript theme={null}
if (Bytes32.isZero(b32)) {
  console.log("Empty slot");
}
```

##### max()

> **max**: (`a`, `b`) => [`Bytes32Type`](#bytes32type)

Return the maximum of two Bytes32 values (lexicographically)

###### Parameters

###### a

[`Bytes32Type`](#bytes32type)

First Bytes32

###### b

[`Bytes32Type`](#bytes32type)

Second Bytes32

###### Returns

[`Bytes32Type`](#bytes32type)

The larger value

###### Example

```typescript theme={null}
const larger = Bytes32.max(a, b);
```

##### min()

> **min**: (`a`, `b`) => [`Bytes32Type`](#bytes32type)

Return the minimum of two Bytes32 values (lexicographically)

###### Parameters

###### a

[`Bytes32Type`](#bytes32type)

First Bytes32

###### b

[`Bytes32Type`](#bytes32type)

Second Bytes32

###### Returns

[`Bytes32Type`](#bytes32type)

The smaller value

###### Example

```typescript theme={null}
const smaller = Bytes32.min(a, b);
```

##### SIZE

> **SIZE**: `number`

Size of Bytes32 in bytes

##### toBigint()

> **toBigint**: (`bytes32`) => `bigint`

Convert Bytes32 to bigint (big-endian)

###### Parameters

###### bytes32

[`Bytes32Type`](#bytes32type)

Bytes32 to convert

###### Returns

`bigint`

Big-endian bigint representation

###### Example

```typescript theme={null}
const value = Bytes32.toBigint(b32);
```

##### toHex()

> **toHex**: (`bytes32`) => `string`

Convert Bytes32 to hex string with 0x prefix

###### Parameters

###### bytes32

[`Bytes32Type`](#bytes32type)

Bytes32 to convert

###### Returns

`string`

Lowercase hex string with 0x prefix (66 chars total)

###### Example

```typescript theme={null}
const hex = Bytes32.toHex(b32);
// "0x000000000000000000000000000000000000000000000000000000000000002a"
```

##### toNumber()

> **toNumber**: (`bytes32`) => `number`

Convert Bytes32 to number (big-endian)

###### Parameters

###### bytes32

[`Bytes32Type`](#bytes32type)

Bytes32 to convert

###### Returns

`number`

Number representation

###### Throws

If value exceeds Number.MAX\_SAFE\_INTEGER

###### Example

```typescript theme={null}
const value = Bytes32.toNumber(b32);
```

##### zero()

> **zero**: () => [`Bytes32Type`](#bytes32type)

Create a zero-filled Bytes32

###### Returns

[`Bytes32Type`](#bytes32type)

New Bytes32 with all zeros

###### Example

```typescript theme={null}
const empty = Bytes32.zero();
```

##### ZERO

> **ZERO**: [`Bytes32Type`](#bytes32type)

Zero constant - 32 bytes of zeros

***

### SIZE

> `const` **SIZE**: `32` = `32`

Defined in: [src/primitives/Bytes32/constants.js:7](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/constants.js#L7)

Size of Bytes32 in bytes

***

### ZERO

> `const` **ZERO**: [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/constants.js:10](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/constants.js#L10)

Zero constant - 32 bytes of zeros

## Functions

### \_bitwiseAnd()

> **\_bitwiseAnd**(`a`, `b`): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/bitwiseAnd.js:15](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/bitwiseAnd.js#L15)

Perform bitwise AND on two Bytes32 values

#### Parameters

##### a

[`Bytes32Type`](#bytes32type)

First Bytes32

##### b

[`Bytes32Type`](#bytes32type)

Second Bytes32

#### Returns

[`Bytes32Type`](#bytes32type)

Result of a & b

#### Example

```typescript theme={null}
const result = Bytes32.bitwiseAnd(a, b);
```

***

### \_bitwiseOr()

> **\_bitwiseOr**(`a`, `b`): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/bitwiseOr.js:15](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/bitwiseOr.js#L15)

Perform bitwise OR on two Bytes32 values

#### Parameters

##### a

[`Bytes32Type`](#bytes32type)

First Bytes32

##### b

[`Bytes32Type`](#bytes32type)

Second Bytes32

#### Returns

[`Bytes32Type`](#bytes32type)

Result of a | b

#### Example

```typescript theme={null}
const result = Bytes32.bitwiseOr(a, b);
```

***

### \_bitwiseXor()

> **\_bitwiseXor**(`a`, `b`): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/bitwiseXor.js:15](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/bitwiseXor.js#L15)

Perform bitwise XOR on two Bytes32 values

#### Parameters

##### a

[`Bytes32Type`](#bytes32type)

First Bytes32

##### b

[`Bytes32Type`](#bytes32type)

Second Bytes32

#### Returns

[`Bytes32Type`](#bytes32type)

Result of a ^ b

#### Example

```typescript theme={null}
const result = Bytes32.bitwiseXor(a, b);
```

***

### \_clone()

> **\_clone**(`bytes32`): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/clone.js:15](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/clone.js#L15)

Create an independent copy of Bytes32

#### Parameters

##### bytes32

[`Bytes32Type`](#bytes32type)

Bytes32 to clone

#### Returns

[`Bytes32Type`](#bytes32type)

New Bytes32 with same values

#### Example

```typescript theme={null}
const copy = Bytes32.clone(original);
// Modifying copy won't affect original
```

***

### \_compare()

> **\_compare**(`a`, `b`): `number`

Defined in: [src/primitives/Bytes32/compare.js:15](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/compare.js#L15)

Compare two Bytes32 values lexicographically

#### Parameters

##### a

[`Bytes32Type`](#bytes32type)

First Bytes32

##### b

[`Bytes32Type`](#bytes32type)

Second Bytes32

#### Returns

`number`

-1 if a \< b, 0 if equal, 1 if a > b

#### Example

```typescript theme={null}
const sorted = bytes32Array.sort(Bytes32.compare);
```

***

### \_equals()

> **\_equals**(`a`, `b`): `boolean`

Defined in: [src/primitives/Bytes32/equals.js:17](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/equals.js#L17)

Check if two Bytes32 values are equal

#### Parameters

##### a

[`Bytes32Type`](#bytes32type)

First Bytes32

##### b

[`Bytes32Type`](#bytes32type)

Second Bytes32

#### Returns

`boolean`

True if equal

#### Example

```typescript theme={null}
if (Bytes32.equals(a, b)) {
  console.log("Values match");
}
```

***

### \_from()

> **\_from**(`value`): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/from.js:22](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/from.js#L22)

Create Bytes32 from various input types (universal constructor)

#### Parameters

##### value

Number, bigint, hex string, or Uint8Array

`string` | `number` | `bigint` | `Uint8Array`\<`ArrayBufferLike`>

#### Returns

[`Bytes32Type`](#bytes32type)

Bytes32

#### Throws

If value type is unsupported or invalid

#### Example

```typescript theme={null}
const b1 = Bytes32.from(42);                    // from number
const b2 = Bytes32.from(42n);                   // from bigint
const b3 = Bytes32.from('0x' + 'ab'.repeat(32)); // from hex
const b4 = Bytes32.from(new Uint8Array(32));    // from bytes
```

***

### \_fromBigint()

> **\_fromBigint**(`value`): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/fromBigint.js:21](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/fromBigint.js#L21)

Create Bytes32 from bigint (big-endian)

#### Parameters

##### value

`bigint`

Bigint to convert (must fit in 256 bits)

#### Returns

[`Bytes32Type`](#bytes32type)

Bytes32

#### Throws

If value is negative or exceeds 256 bits

#### Example

```typescript theme={null}
const b32 = Bytes32.fromBigint(0x123456789abcdef0n);
```

***

### \_fromBytes()

> **\_fromBytes**(`bytes`): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/fromBytes.js:18](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/fromBytes.js#L18)

Create Bytes32 from bytes. Input must be exactly 32 bytes.

#### Parameters

##### bytes

`Uint8Array`\<`ArrayBufferLike`>

Input bytes (must be 32 bytes)

#### Returns

[`Bytes32Type`](#bytes32type)

Bytes32

#### Throws

If bytes length is not 32

#### Example

```typescript theme={null}
const bytes = new Uint8Array(32);
bytes[0] = 1;
const b32 = Bytes32.fromBytes(bytes);
```

***

### \_fromHex()

> **\_fromHex**(`hex`): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/fromHex.js:18](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/fromHex.js#L18)

Create Bytes32 from hex string (with or without 0x prefix)

#### Parameters

##### hex

`string`

Hex string (64 chars, with or without 0x prefix)

#### Returns

[`Bytes32Type`](#bytes32type)

Bytes32

#### Throws

If hex length is not 64 characters

#### Throws

If hex contains invalid characters

#### Example

```typescript theme={null}
const b32 = Bytes32.fromHex('0x' + 'ab'.repeat(32));
const b32Alt = Bytes32.fromHex('ab'.repeat(32));
```

***

### \_fromNumber()

> **\_fromNumber**(`value`): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/fromNumber.js:15](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/fromNumber.js#L15)

Create Bytes32 from number (big-endian, zero-padded)

#### Parameters

##### value

`number`

Number to convert

#### Returns

[`Bytes32Type`](#bytes32type)

Bytes32

#### Example

```typescript theme={null}
const b32 = Bytes32.fromNumber(42);
// Last byte is 42, rest are zeros
```

***

### \_isZero()

> **\_isZero**(`bytes32`): `boolean`

Defined in: [src/primitives/Bytes32/isZero.js:16](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/isZero.js#L16)

Check if Bytes32 is all zeros

#### Parameters

##### bytes32

[`Bytes32Type`](#bytes32type)

Bytes32 to check

#### Returns

`boolean`

True if all bytes are zero

#### Example

```typescript theme={null}
if (Bytes32.isZero(b32)) {
  console.log("Empty slot");
}
```

***

### \_max()

> **\_max**(`a`, `b`): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/max.js:15](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/max.js#L15)

Return the maximum of two Bytes32 values (lexicographically)

#### Parameters

##### a

[`Bytes32Type`](#bytes32type)

First Bytes32

##### b

[`Bytes32Type`](#bytes32type)

Second Bytes32

#### Returns

[`Bytes32Type`](#bytes32type)

The larger value

#### Example

```typescript theme={null}
const larger = Bytes32.max(a, b);
```

***

### \_min()

> **\_min**(`a`, `b`): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/min.js:15](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/min.js#L15)

Return the minimum of two Bytes32 values (lexicographically)

#### Parameters

##### a

[`Bytes32Type`](#bytes32type)

First Bytes32

##### b

[`Bytes32Type`](#bytes32type)

Second Bytes32

#### Returns

[`Bytes32Type`](#bytes32type)

The smaller value

#### Example

```typescript theme={null}
const smaller = Bytes32.min(a, b);
```

***

### \_toBigint()

> **\_toBigint**(`bytes32`): `bigint`

Defined in: [src/primitives/Bytes32/toBigint.js:12](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/toBigint.js#L12)

Convert Bytes32 to bigint (big-endian)

#### Parameters

##### bytes32

[`Bytes32Type`](#bytes32type)

Bytes32 to convert

#### Returns

`bigint`

Big-endian bigint representation

#### Example

```typescript theme={null}
const value = Bytes32.toBigint(b32);
```

***

### \_toHex()

> **\_toHex**(`bytes32`): `string`

Defined in: [src/primitives/Bytes32/toHex.js:13](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/toHex.js#L13)

Convert Bytes32 to hex string with 0x prefix

#### Parameters

##### bytes32

[`Bytes32Type`](#bytes32type)

Bytes32 to convert

#### Returns

`string`

Lowercase hex string with 0x prefix (66 chars total)

#### Example

```typescript theme={null}
const hex = Bytes32.toHex(b32);
// "0x000000000000000000000000000000000000000000000000000000000000002a"
```

***

### \_toNumber()

> **\_toNumber**(`bytes32`): `number`

Defined in: [src/primitives/Bytes32/toNumber.js:21](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/toNumber.js#L21)

Convert Bytes32 to number (big-endian)

#### Parameters

##### bytes32

[`Bytes32Type`](#bytes32type)

Bytes32 to convert

#### Returns

`number`

Number representation

#### Throws

If value exceeds Number.MAX\_SAFE\_INTEGER

#### Example

```typescript theme={null}
const value = Bytes32.toNumber(b32);
```

***

### \_zero()

> **\_zero**(): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/zero.js:13](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/zero.js#L13)

Create a zero-filled Bytes32

#### Returns

[`Bytes32Type`](#bytes32type)

New Bytes32 with all zeros

#### Example

```typescript theme={null}
const empty = Bytes32.zero();
```

***

### bitwiseAnd()

> **bitwiseAnd**(`a`, `b`): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/bitwiseAnd.js:15](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/bitwiseAnd.js#L15)

Perform bitwise AND on two Bytes32 values

#### Parameters

##### a

[`Bytes32Type`](#bytes32type)

First Bytes32

##### b

[`Bytes32Type`](#bytes32type)

Second Bytes32

#### Returns

[`Bytes32Type`](#bytes32type)

Result of a & b

#### Example

```typescript theme={null}
const result = Bytes32.bitwiseAnd(a, b);
```

***

### bitwiseOr()

> **bitwiseOr**(`a`, `b`): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/bitwiseOr.js:15](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/bitwiseOr.js#L15)

Perform bitwise OR on two Bytes32 values

#### Parameters

##### a

[`Bytes32Type`](#bytes32type)

First Bytes32

##### b

[`Bytes32Type`](#bytes32type)

Second Bytes32

#### Returns

[`Bytes32Type`](#bytes32type)

Result of a | b

#### Example

```typescript theme={null}
const result = Bytes32.bitwiseOr(a, b);
```

***

### bitwiseXor()

> **bitwiseXor**(`a`, `b`): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/bitwiseXor.js:15](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/bitwiseXor.js#L15)

Perform bitwise XOR on two Bytes32 values

#### Parameters

##### a

[`Bytes32Type`](#bytes32type)

First Bytes32

##### b

[`Bytes32Type`](#bytes32type)

Second Bytes32

#### Returns

[`Bytes32Type`](#bytes32type)

Result of a ^ b

#### Example

```typescript theme={null}
const result = Bytes32.bitwiseXor(a, b);
```

***

### clone()

> **clone**(`bytes32`): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/clone.js:15](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/clone.js#L15)

Create an independent copy of Bytes32

#### Parameters

##### bytes32

[`Bytes32Type`](#bytes32type)

Bytes32 to clone

#### Returns

[`Bytes32Type`](#bytes32type)

New Bytes32 with same values

#### Example

```typescript theme={null}
const copy = Bytes32.clone(original);
// Modifying copy won't affect original
```

***

### compare()

> **compare**(`a`, `b`): `number`

Defined in: [src/primitives/Bytes32/compare.js:15](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/compare.js#L15)

Compare two Bytes32 values lexicographically

#### Parameters

##### a

[`Bytes32Type`](#bytes32type)

First Bytes32

##### b

[`Bytes32Type`](#bytes32type)

Second Bytes32

#### Returns

`number`

-1 if a \< b, 0 if equal, 1 if a > b

#### Example

```typescript theme={null}
const sorted = bytes32Array.sort(Bytes32.compare);
```

***

### equals()

> **equals**(`a`, `b`): `boolean`

Defined in: [src/primitives/Bytes32/equals.js:17](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/equals.js#L17)

Check if two Bytes32 values are equal

#### Parameters

##### a

[`Bytes32Type`](#bytes32type)

First Bytes32

##### b

[`Bytes32Type`](#bytes32type)

Second Bytes32

#### Returns

`boolean`

True if equal

#### Example

```typescript theme={null}
if (Bytes32.equals(a, b)) {
  console.log("Values match");
}
```

***

### from()

> **from**(`value`): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/from.js:22](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/from.js#L22)

Create Bytes32 from various input types (universal constructor)

#### Parameters

##### value

Number, bigint, hex string, or Uint8Array

`string` | `number` | `bigint` | `Uint8Array`\<`ArrayBufferLike`>

#### Returns

[`Bytes32Type`](#bytes32type)

Bytes32

#### Throws

If value type is unsupported or invalid

#### Example

```typescript theme={null}
const b1 = Bytes32.from(42);                    // from number
const b2 = Bytes32.from(42n);                   // from bigint
const b3 = Bytes32.from('0x' + 'ab'.repeat(32)); // from hex
const b4 = Bytes32.from(new Uint8Array(32));    // from bytes
```

***

### fromBigint()

> **fromBigint**(`value`): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/fromBigint.js:21](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/fromBigint.js#L21)

Create Bytes32 from bigint (big-endian)

#### Parameters

##### value

`bigint`

Bigint to convert (must fit in 256 bits)

#### Returns

[`Bytes32Type`](#bytes32type)

Bytes32

#### Throws

If value is negative or exceeds 256 bits

#### Example

```typescript theme={null}
const b32 = Bytes32.fromBigint(0x123456789abcdef0n);
```

***

### fromBytes()

> **fromBytes**(`bytes`): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/fromBytes.js:18](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/fromBytes.js#L18)

Create Bytes32 from bytes. Input must be exactly 32 bytes.

#### Parameters

##### bytes

`Uint8Array`\<`ArrayBufferLike`>

Input bytes (must be 32 bytes)

#### Returns

[`Bytes32Type`](#bytes32type)

Bytes32

#### Throws

If bytes length is not 32

#### Example

```typescript theme={null}
const bytes = new Uint8Array(32);
bytes[0] = 1;
const b32 = Bytes32.fromBytes(bytes);
```

***

### fromHex()

> **fromHex**(`hex`): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/fromHex.js:18](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/fromHex.js#L18)

Create Bytes32 from hex string (with or without 0x prefix)

#### Parameters

##### hex

`string`

Hex string (64 chars, with or without 0x prefix)

#### Returns

[`Bytes32Type`](#bytes32type)

Bytes32

#### Throws

If hex length is not 64 characters

#### Throws

If hex contains invalid characters

#### Example

```typescript theme={null}
const b32 = Bytes32.fromHex('0x' + 'ab'.repeat(32));
const b32Alt = Bytes32.fromHex('ab'.repeat(32));
```

***

### fromNumber()

> **fromNumber**(`value`): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/fromNumber.js:15](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/fromNumber.js#L15)

Create Bytes32 from number (big-endian, zero-padded)

#### Parameters

##### value

`number`

Number to convert

#### Returns

[`Bytes32Type`](#bytes32type)

Bytes32

#### Example

```typescript theme={null}
const b32 = Bytes32.fromNumber(42);
// Last byte is 42, rest are zeros
```

***

### isZero()

> **isZero**(`bytes32`): `boolean`

Defined in: [src/primitives/Bytes32/isZero.js:16](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/isZero.js#L16)

Check if Bytes32 is all zeros

#### Parameters

##### bytes32

[`Bytes32Type`](#bytes32type)

Bytes32 to check

#### Returns

`boolean`

True if all bytes are zero

#### Example

```typescript theme={null}
if (Bytes32.isZero(b32)) {
  console.log("Empty slot");
}
```

***

### max()

> **max**(`a`, `b`): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/max.js:15](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/max.js#L15)

Return the maximum of two Bytes32 values (lexicographically)

#### Parameters

##### a

[`Bytes32Type`](#bytes32type)

First Bytes32

##### b

[`Bytes32Type`](#bytes32type)

Second Bytes32

#### Returns

[`Bytes32Type`](#bytes32type)

The larger value

#### Example

```typescript theme={null}
const larger = Bytes32.max(a, b);
```

***

### min()

> **min**(`a`, `b`): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/min.js:15](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/min.js#L15)

Return the minimum of two Bytes32 values (lexicographically)

#### Parameters

##### a

[`Bytes32Type`](#bytes32type)

First Bytes32

##### b

[`Bytes32Type`](#bytes32type)

Second Bytes32

#### Returns

[`Bytes32Type`](#bytes32type)

The smaller value

#### Example

```typescript theme={null}
const smaller = Bytes32.min(a, b);
```

***

### toBigint()

> **toBigint**(`bytes32`): `bigint`

Defined in: [src/primitives/Bytes32/toBigint.js:12](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/toBigint.js#L12)

Convert Bytes32 to bigint (big-endian)

#### Parameters

##### bytes32

[`Bytes32Type`](#bytes32type)

Bytes32 to convert

#### Returns

`bigint`

Big-endian bigint representation

#### Example

```typescript theme={null}
const value = Bytes32.toBigint(b32);
```

***

### toHex()

> **toHex**(`bytes32`): `string`

Defined in: [src/primitives/Bytes32/toHex.js:13](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/toHex.js#L13)

Convert Bytes32 to hex string with 0x prefix

#### Parameters

##### bytes32

[`Bytes32Type`](#bytes32type)

Bytes32 to convert

#### Returns

`string`

Lowercase hex string with 0x prefix (66 chars total)

#### Example

```typescript theme={null}
const hex = Bytes32.toHex(b32);
// "0x000000000000000000000000000000000000000000000000000000000000002a"
```

***

### toNumber()

> **toNumber**(`bytes32`): `number`

Defined in: [src/primitives/Bytes32/toNumber.js:21](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/toNumber.js#L21)

Convert Bytes32 to number (big-endian)

#### Parameters

##### bytes32

[`Bytes32Type`](#bytes32type)

Bytes32 to convert

#### Returns

`number`

Number representation

#### Throws

If value exceeds Number.MAX\_SAFE\_INTEGER

#### Example

```typescript theme={null}
const value = Bytes32.toNumber(b32);
```

***

### zero()

> **zero**(): [`Bytes32Type`](#bytes32type)

Defined in: [src/primitives/Bytes32/zero.js:13](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Bytes32/zero.js#L13)

Create a zero-filled Bytes32

#### Returns

[`Bytes32Type`](#bytes32type)

New Bytes32 with all zeros

#### Example

```typescript theme={null}
const empty = Bytes32.zero();
```

## References

### default

Renames and re-exports [Bytes32](#bytes32)
