> ## 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/BlockHash

> Auto-generated API documentation

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

***

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

# primitives/BlockHash

## Classes

### InvalidBlockHashFormatError

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

#### Extends

* `Error`

#### Constructors

##### Constructor

> **new InvalidBlockHashFormatError**(`message`, `details?`): [`InvalidBlockHashFormatError`](#invalidblockhashformaterror)

Defined in: [src/primitives/BlockHash/errors.js:25](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/BlockHash/errors.js#L25)

###### Parameters

###### message

`string`

###### details?

###### expected?

`string`

###### value?

`unknown`

###### Returns

[`InvalidBlockHashFormatError`](#invalidblockhashformaterror)

###### Overrides

`Error.constructor`

#### Properties

##### details

> **details**: \{ `expected?`: `string`; `value?`: `unknown`; } | `undefined`

Defined in: [src/primitives/BlockHash/errors.js:29](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/BlockHash/errors.js#L29)

##### name

> **name**: `string`

Defined in: [src/primitives/BlockHash/errors.js:27](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/BlockHash/errors.js#L27)

###### Inherited from

`Error.name`

***

### InvalidBlockHashLengthError

Defined in: [src/primitives/BlockHash/errors.js:1](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/BlockHash/errors.js#L1)

#### Extends

* `Error`

#### Constructors

##### Constructor

> **new InvalidBlockHashLengthError**(`message`, `details?`): [`InvalidBlockHashLengthError`](#invalidblockhashlengtherror)

Defined in: [src/primitives/BlockHash/errors.js:9](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/BlockHash/errors.js#L9)

###### Parameters

###### message

`string`

###### details?

###### context?

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

###### expected?

`string`

###### value?

`unknown`

###### Returns

[`InvalidBlockHashLengthError`](#invalidblockhashlengtherror)

###### Overrides

`Error.constructor`

#### Properties

##### details

> **details**: \{ `context?`: `Record`\<`string`, `unknown`>; `expected?`: `string`; `value?`: `unknown`; } | `undefined`

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

##### name

> **name**: `string`

Defined in: [src/primitives/BlockHash/errors.js:11](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/BlockHash/errors.js#L11)

###### Inherited from

`Error.name`

## Type Aliases

### BlockHashType

> **BlockHashType** = `Uint8Array` & `object`

Defined in: [src/primitives/BlockHash/BlockHashType.ts:6](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/BlockHash/BlockHashType.ts#L6)

Block hash (32-byte identifier)

#### Type Declaration

##### \[brand]

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

##### length

> `readonly` **length**: `32`

## Variables

### equals()

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

Defined in: [src/primitives/BlockHash/index.ts:14](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/BlockHash/index.ts#L14)

Check if two BlockHashes are equal

#### Parameters

##### a

[`BlockHashType`](#blockhashtype)

##### b

[`BlockHashType`](#blockhashtype)

#### Returns

`boolean`

***

### from()

> `const` **from**: (`value`) => [`BlockHashType`](#blockhashtype) = `_from`

Defined in: [src/primitives/BlockHash/index.ts:10](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/BlockHash/index.ts#L10)

Create BlockHash from various input types

#### Parameters

##### value

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

#### Returns

[`BlockHashType`](#blockhashtype)

#### Throws

***

### fromBytes()

> `const` **fromBytes**: (`bytes`) => [`BlockHashType`](#blockhashtype) = `_fromBytes`

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

Create BlockHash from bytes

#### Parameters

##### bytes

`Uint8Array`\<`ArrayBufferLike`>

#### Returns

[`BlockHashType`](#blockhashtype)

#### Throws

***

### fromHex()

> `const` **fromHex**: (`hex`) => [`BlockHashType`](#blockhashtype) = `_fromHex`

Defined in: [src/primitives/BlockHash/index.ts:12](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/BlockHash/index.ts#L12)

Create BlockHash from hex string

#### Parameters

##### hex

`string`

#### Returns

[`BlockHashType`](#blockhashtype)

#### Throws

***

### toHex()

> `const` **toHex**: (`hash`) => `string` = `_toHex`

Defined in: [src/primitives/BlockHash/index.ts:13](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/BlockHash/index.ts#L13)

Convert BlockHash to hex string

#### Parameters

##### hash

[`BlockHashType`](#blockhashtype)

#### Returns

`string`
