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

> Auto-generated API documentation

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

***

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

# primitives/Uint64

## Type Aliases

### Uint64Type

> **Uint64Type** = `bigint` & `object`

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

Uint64 type

64-bit unsigned integer (0 to 18446744073709551615).
Uses bigint to handle values beyond Number.MAX\_SAFE\_INTEGER.
Used for timestamps, large counters, nonces.

#### Type Declaration

##### \[brand]

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

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

## Variables

### MAX

> `const` **MAX**: [`Uint64Type`](#uint64type)

Defined in: [src/primitives/Uint64/constants.js:34](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Uint64/constants.js#L34)

Maximum Uint64 value: 2^64 - 1 = 18446744073709551615n

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Example

```javascript theme={null}
import { MAX } from './primitives/Uint64/index.js';
console.log(MAX); // 18446744073709551615n
```

***

### MIN

> `const` **MIN**: [`Uint64Type`](#uint64type)

Defined in: [src/primitives/Uint64/constants.js:50](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Uint64/constants.js#L50)

Minimum Uint64 value: 0n

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Example

```javascript theme={null}
import { MIN } from './primitives/Uint64/index.js';
console.log(MIN); // 0n
```

***

### ONE

> `const` **ONE**: [`Uint64Type`](#uint64type)

Defined in: [src/primitives/Uint64/constants.js:78](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Uint64/constants.js#L78)

One value

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Example

```javascript theme={null}
import { ONE } from './primitives/Uint64/index.js';
console.log(ONE); // 1n
```

***

### SIZE

> `const` **SIZE**: `8` = `8`

Defined in: [src/primitives/Uint64/constants.js:20](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Uint64/constants.js#L20)

Size in bytes (8 bytes for Uint64)

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Example

```javascript theme={null}
import { SIZE } from './primitives/Uint64/index.js';
console.log(SIZE); // 8
```

***

### Uint64

> `const` **Uint64**: `object`

Defined in: [src/primitives/Uint64/index.ts:82](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Uint64/index.ts#L82)

#### Type Declaration

##### bitLength()

> **bitLength**: (`uint`) => `number`

Calculate bit length of Uint64 value

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

Value

###### Returns

`number`

Number of bits needed to represent value

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(255n);
const result = Uint64.bitLength(a); // 8
```

##### bitwiseAnd()

> **bitwiseAnd**: (`uint`, `b`) => [`Uint64Type`](#uint64type)

Bitwise AND Uint64 values

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

First operand

###### b

[`Uint64Type`](#uint64type)

Second operand

###### Returns

[`Uint64Type`](#uint64type)

Result (uint & b)

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(0b1100n);
const b = Uint64.from(0b1010n);
const result = Uint64.bitwiseAnd(a, b); // 0b1000n = 8n
```

##### bitwiseNot()

> **bitwiseNot**: (`uint`) => [`Uint64Type`](#uint64type)

Bitwise NOT Uint64 value

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

Operand

###### Returns

[`Uint64Type`](#uint64type)

Result (\~uint)

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(0n);
const result = Uint64.bitwiseNot(a); // 18446744073709551615n (all bits set)
```

##### bitwiseOr()

> **bitwiseOr**: (`uint`, `b`) => [`Uint64Type`](#uint64type)

Bitwise OR Uint64 values

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

First operand

###### b

[`Uint64Type`](#uint64type)

Second operand

###### Returns

[`Uint64Type`](#uint64type)

Result (uint | b)

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(0b1100n);
const b = Uint64.from(0b1010n);
const result = Uint64.bitwiseOr(a, b); // 0b1110n = 14n
```

##### bitwiseXor()

> **bitwiseXor**: (`uint`, `b`) => [`Uint64Type`](#uint64type)

Bitwise XOR Uint64 values

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

First operand

###### b

[`Uint64Type`](#uint64type)

Second operand

###### Returns

[`Uint64Type`](#uint64type)

Result (uint ^ b)

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(0b1100n);
const b = Uint64.from(0b1010n);
const result = Uint64.bitwiseXor(a, b); // 0b0110n = 6n
```

##### clone()

> **clone**: (`uint`) => [`Uint64Type`](#uint64type)

Clone Uint64 value

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

Value to clone

###### Returns

[`Uint64Type`](#uint64type)

Cloned value

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(100n);
const b = Uint64.clone(a);
```

##### dividedBy()

> **dividedBy**: (`uint`, `b`) => [`Uint64Type`](#uint64type)

Divide Uint64 value (integer division)

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

Dividend

###### b

[`Uint64Type`](#uint64type)

Divisor

###### Returns

[`Uint64Type`](#uint64type)

Quotient (uint / b) truncated

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

If divisor is zero

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(100n);
const b = Uint64.from(3n);
const quotient = Uint64.dividedBy(a, b); // 33n
```

##### equals()

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

Check if Uint64 values are equal

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

First value

###### b

[`Uint64Type`](#uint64type)

Second value

###### Returns

`boolean`

true if equal

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(100n);
const b = Uint64.from(100n);
const result = Uint64.equals(a, b); // true
```

##### from()

> **from**: (`value`) => [`Uint64Type`](#uint64type)

Create Uint64 from bigint, number, or string

###### Parameters

###### value

bigint, number, or decimal/hex string

`string` | `number` | `bigint`

###### Returns

[`Uint64Type`](#uint64type)

Uint64 value

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

If value is out of range or invalid

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(100n);
const b = Uint64.from("18446744073709551615");
const c = Uint64.from("0xffffffffffffffff");
const d = Uint64.from(42);
```

##### fromAbiEncoded()

> **fromAbiEncoded**: (`bytes`) => [`Uint64Type`](#uint64type)

Create Uint64 from ABI-encoded bytes (32 bytes, big-endian, left-padded)

###### Parameters

###### bytes

`Uint8Array`\<`ArrayBufferLike`>

ABI-encoded byte array (32 bytes)

###### Returns

[`Uint64Type`](#uint64type)

Uint64 value

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

If bytes length is not 32

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const abiBytes = new Uint8Array(32);
abiBytes[31] = 255;
const value = Uint64.fromAbiEncoded(abiBytes); // 255n
```

##### fromBigInt()

> **fromBigInt**: (`value`) => [`Uint64Type`](#uint64type)

Create Uint64 from bigint

###### Parameters

###### value

`bigint`

bigint value

###### Returns

[`Uint64Type`](#uint64type)

Uint64 value

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

If value is out of range

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const value = Uint64.fromBigInt(100n);
```

##### fromBytes()

> **fromBytes**: (`bytes`) => [`Uint64Type`](#uint64type)

Create Uint64 from bytes (big-endian, 8 bytes)

###### Parameters

###### bytes

`Uint8Array`\<`ArrayBufferLike`>

byte array (must be exactly 8 bytes)

###### Returns

[`Uint64Type`](#uint64type)

Uint64 value

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

If bytes length is not 8

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const bytes = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 255]);
const value = Uint64.fromBytes(bytes); // 255n
```

##### fromHex()

> **fromHex**: (`hex`) => [`Uint64Type`](#uint64type)

Create Uint64 from hex string

###### Parameters

###### hex

`string`

hex string (with or without 0x prefix)

###### Returns

[`Uint64Type`](#uint64type)

Uint64 value

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

If value is out of range or invalid hex

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.fromHex("0xffffffffffffffff");
const b = Uint64.fromHex("ff");
```

##### fromNumber()

> **fromNumber**: (`value`) => [`Uint64Type`](#uint64type)

Create Uint64 from number
WARNING: Values above Number.MAX\_SAFE\_INTEGER may lose precision

###### Parameters

###### value

`number`

number value

###### Returns

[`Uint64Type`](#uint64type)

Uint64 value

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

If value is out of range or invalid

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const value = Uint64.fromNumber(42);
```

##### greaterThan()

> **greaterThan**: (`uint`, `b`) => `boolean`

Check if Uint64 value is greater than another

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

First value

###### b

[`Uint64Type`](#uint64type)

Second value

###### Returns

`boolean`

true if uint > b

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(200n);
const b = Uint64.from(100n);
const result = Uint64.greaterThan(a, b); // true
```

##### isValid()

> **isValid**: (`value`) => `value is Uint64Type`

Check if value is a valid Uint64

###### Parameters

###### value

`unknown`

Value to check

###### Returns

`value is Uint64Type`

true if valid Uint64

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const result1 = Uint64.isValid(100n); // true
const result2 = Uint64.isValid(-1n); // false
const result3 = Uint64.isValid(100); // false (must be bigint)
```

##### isZero()

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

Check if Uint64 value is zero

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

Value to check

###### Returns

`boolean`

true if zero

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(0n);
const result = Uint64.isZero(a); // true
```

##### leadingZeros()

> **leadingZeros**: (`uint`) => `number`

Count leading zeros in Uint64 value

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

Value

###### Returns

`number`

Number of leading zero bits

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(255n);
const result = Uint64.leadingZeros(a); // 56
```

##### lessThan()

> **lessThan**: (`uint`, `b`) => `boolean`

Check if Uint64 value is less than another

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

First value

###### b

[`Uint64Type`](#uint64type)

Second value

###### Returns

`boolean`

true if uint \< b

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(100n);
const b = Uint64.from(200n);
const result = Uint64.lessThan(a, b); // true
```

##### MAX

> **MAX**: [`Uint64Type`](#uint64type)

Maximum Uint64 value: 2^64 - 1 = 18446744073709551615n

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Example

```javascript theme={null}
import { MAX } from './primitives/Uint64/index.js';
console.log(MAX); // 18446744073709551615n
```

##### maximum()

> **maximum**: (`uint`, `b`) => [`Uint64Type`](#uint64type)

Return maximum of two Uint64 values

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

First value

###### b

[`Uint64Type`](#uint64type)

Second value

###### Returns

[`Uint64Type`](#uint64type)

Maximum value

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(100n);
const b = Uint64.from(200n);
const result = Uint64.maximum(a, b); // 200n
```

##### MIN

> **MIN**: [`Uint64Type`](#uint64type)

Minimum Uint64 value: 0n

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Example

```javascript theme={null}
import { MIN } from './primitives/Uint64/index.js';
console.log(MIN); // 0n
```

##### minimum()

> **minimum**: (`uint`, `b`) => [`Uint64Type`](#uint64type)

Return minimum of two Uint64 values

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

First value

###### b

[`Uint64Type`](#uint64type)

Second value

###### Returns

[`Uint64Type`](#uint64type)

Minimum value

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(100n);
const b = Uint64.from(200n);
const result = Uint64.minimum(a, b); // 100n
```

##### minus()

> **minus**: (`uint`, `b`) => [`Uint64Type`](#uint64type)

Subtract Uint64 value with wrapping

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

First operand

###### b

[`Uint64Type`](#uint64type)

Second operand

###### Returns

[`Uint64Type`](#uint64type)

Difference (uint - b) mod 2^64

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(100n);
const b = Uint64.from(50n);
const diff = Uint64.minus(a, b); // 50n
```

##### modulo()

> **modulo**: (`uint`, `b`) => [`Uint64Type`](#uint64type)

Modulo Uint64 value

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

Dividend

###### b

[`Uint64Type`](#uint64type)

Divisor

###### Returns

[`Uint64Type`](#uint64type)

Remainder (uint % b)

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

If divisor is zero

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(100n);
const b = Uint64.from(3n);
const remainder = Uint64.modulo(a, b); // 1n
```

##### ONE

> **ONE**: [`Uint64Type`](#uint64type)

One value

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Example

```javascript theme={null}
import { ONE } from './primitives/Uint64/index.js';
console.log(ONE); // 1n
```

##### plus()

> **plus**: (`uint`, `b`) => [`Uint64Type`](#uint64type)

Add Uint64 value with wrapping

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

First operand

###### b

[`Uint64Type`](#uint64type)

Second operand

###### Returns

[`Uint64Type`](#uint64type)

Sum (uint + b) mod 2^64

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(100n);
const b = Uint64.from(50n);
const sum = Uint64.plus(a, b); // 150n
```

##### popCount()

> **popCount**: (`uint`) => `number`

Count set bits (population count) in Uint64 value

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

Value

###### Returns

`number`

Number of set bits

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(0b1111n);
const result = Uint64.popCount(a); // 4
```

##### shiftLeft()

> **shiftLeft**: (`uint`, `bits`) => [`Uint64Type`](#uint64type)

Left shift Uint64 value

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

Value to shift

###### bits

Number of bits to shift (0-63)

`number` | `bigint`

###### Returns

[`Uint64Type`](#uint64type)

Result (uint shifted left by bits) mod 2^64

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(1n);
const result = Uint64.shiftLeft(a, 8n); // 256n
```

##### shiftRight()

> **shiftRight**: (`uint`, `bits`) => [`Uint64Type`](#uint64type)

Right shift Uint64 value (logical shift, zero-fill)

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

Value to shift

###### bits

Number of bits to shift (0-63)

`number` | `bigint`

###### Returns

[`Uint64Type`](#uint64type)

Result (uint shifted right by bits)

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(256n);
const result = Uint64.shiftRight(a, 8n); // 1n
```

##### SIZE

> **SIZE**: `8`

Size in bytes (8 bytes for Uint64)

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Example

```javascript theme={null}
import { SIZE } from './primitives/Uint64/index.js';
console.log(SIZE); // 8
```

##### times()

> **times**: (`uint`, `b`) => [`Uint64Type`](#uint64type)

Multiply Uint64 value with wrapping

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

First operand

###### b

[`Uint64Type`](#uint64type)

Second operand

###### Returns

[`Uint64Type`](#uint64type)

Product (uint \* b) mod 2^64

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(100n);
const b = Uint64.from(50n);
const product = Uint64.times(a, b); // 5000n
```

##### toAbiEncoded()

> **toAbiEncoded**: (`uint`) => `Uint8Array`\<`ArrayBufferLike`>

Convert Uint64 to ABI-encoded bytes (32 bytes, big-endian, left-padded with zeros)

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

Uint64 value to convert

###### Returns

`Uint8Array`\<`ArrayBufferLike`>

32-byte Uint8Array

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const value = Uint64.from(255n);
const abiBytes = Uint64.toAbiEncoded(value);
```

##### toBigInt()

> **toBigInt**: (`uint`) => `bigint`

Convert Uint64 to bigint

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

Uint64 value to convert

###### Returns

`bigint`

bigint value

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const value = Uint64.from(255n);
const bigintValue = Uint64.toBigInt(value); // 255n
```

##### toBytes()

> **toBytes**: (`uint`) => `Uint8Array`\<`ArrayBufferLike`>

Convert Uint64 to bytes (big-endian, 8 bytes)

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

Uint64 value to convert

###### Returns

`Uint8Array`\<`ArrayBufferLike`>

8-byte Uint8Array

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const value = Uint64.from(255n);
const bytes = Uint64.toBytes(value);
```

##### toHex()

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

Convert Uint64 to hex string (with 0x prefix)

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

Uint64 value to convert

###### Returns

`string`

hex string with 0x prefix

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const value = Uint64.from(255n);
const hex = Uint64.toHex(value); // "0xff"
```

##### toNumber()

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

Convert Uint64 to number
WARNING: Values above Number.MAX\_SAFE\_INTEGER (9007199254740991) may lose precision

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

Uint64 value to convert

###### Returns

`number`

number value

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const value = Uint64.from(255n);
const num = Uint64.toNumber(value); // 255
```

##### toPower()

> **toPower**: (`uint`, `exp`) => [`Uint64Type`](#uint64type)

Raise Uint64 to power with wrapping

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

Base

###### exp

[`Uint64Type`](#uint64type)

Exponent

###### Returns

[`Uint64Type`](#uint64type)

Result (uint ^ exp) mod 2^64

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const base = Uint64.from(2n);
const exp = Uint64.from(10n);
const result = Uint64.toPower(base, exp); // 1024n
```

##### toString()

> **toString**: (`uint`) => `string`

Convert Uint64 to string

###### Parameters

###### uint

[`Uint64Type`](#uint64type)

Uint64 value to convert

###### Returns

`string`

decimal string representation

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const value = Uint64.from(255n);
const str = Uint64.toString(value); // "255"
```

##### tryFrom()

> **tryFrom**: (`value`) => [`Uint64Type`](#uint64type) | `null`

Try to create Uint64 from value, return null if invalid

###### Parameters

###### value

`unknown`

Value to convert

###### Returns

[`Uint64Type`](#uint64type) | `null`

Uint64 value or null

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.tryFrom(100n); // 100n
const b = Uint64.tryFrom(-1n); // null
const c = Uint64.tryFrom("not a number"); // null
```

##### ZERO

> **ZERO**: [`Uint64Type`](#uint64type)

Zero value

###### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

###### Since

0.0.0

###### Example

```javascript theme={null}
import { ZERO } from './primitives/Uint64/index.js';
console.log(ZERO); // 0n
```

***

### ZERO

> `const` **ZERO**: [`Uint64Type`](#uint64type)

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

Zero value

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Example

```javascript theme={null}
import { ZERO } from './primitives/Uint64/index.js';
console.log(ZERO); // 0n
```

## Functions

### bitLength()

> **bitLength**(`uint`): `number`

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

Calculate bit length of Uint64 value

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

Value

#### Returns

`number`

Number of bits needed to represent value

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(255n);
const result = Uint64.bitLength(a); // 8
```

***

### bitwiseAnd()

> **bitwiseAnd**(`uint`, `b`): [`Uint64Type`](#uint64type)

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

Bitwise AND Uint64 values

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

First operand

##### b

[`Uint64Type`](#uint64type)

Second operand

#### Returns

[`Uint64Type`](#uint64type)

Result (uint & b)

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(0b1100n);
const b = Uint64.from(0b1010n);
const result = Uint64.bitwiseAnd(a, b); // 0b1000n = 8n
```

***

### bitwiseNot()

> **bitwiseNot**(`uint`): [`Uint64Type`](#uint64type)

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

Bitwise NOT Uint64 value

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

Operand

#### Returns

[`Uint64Type`](#uint64type)

Result (\~uint)

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(0n);
const result = Uint64.bitwiseNot(a); // 18446744073709551615n (all bits set)
```

***

### bitwiseOr()

> **bitwiseOr**(`uint`, `b`): [`Uint64Type`](#uint64type)

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

Bitwise OR Uint64 values

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

First operand

##### b

[`Uint64Type`](#uint64type)

Second operand

#### Returns

[`Uint64Type`](#uint64type)

Result (uint | b)

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(0b1100n);
const b = Uint64.from(0b1010n);
const result = Uint64.bitwiseOr(a, b); // 0b1110n = 14n
```

***

### bitwiseXor()

> **bitwiseXor**(`uint`, `b`): [`Uint64Type`](#uint64type)

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

Bitwise XOR Uint64 values

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

First operand

##### b

[`Uint64Type`](#uint64type)

Second operand

#### Returns

[`Uint64Type`](#uint64type)

Result (uint ^ b)

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(0b1100n);
const b = Uint64.from(0b1010n);
const result = Uint64.bitwiseXor(a, b); // 0b0110n = 6n
```

***

### clone()

> **clone**(`uint`): [`Uint64Type`](#uint64type)

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

Clone Uint64 value

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

Value to clone

#### Returns

[`Uint64Type`](#uint64type)

Cloned value

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(100n);
const b = Uint64.clone(a);
```

***

### dividedBy()

> **dividedBy**(`uint`, `b`): [`Uint64Type`](#uint64type)

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

Divide Uint64 value (integer division)

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

Dividend

##### b

[`Uint64Type`](#uint64type)

Divisor

#### Returns

[`Uint64Type`](#uint64type)

Quotient (uint / b) truncated

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

If divisor is zero

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(100n);
const b = Uint64.from(3n);
const quotient = Uint64.dividedBy(a, b); // 33n
```

***

### equals()

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

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

Check if Uint64 values are equal

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

First value

##### b

[`Uint64Type`](#uint64type)

Second value

#### Returns

`boolean`

true if equal

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(100n);
const b = Uint64.from(100n);
const result = Uint64.equals(a, b); // true
```

***

### from()

> **from**(`value`): [`Uint64Type`](#uint64type)

Defined in: [src/primitives/Uint64/from.js:20](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Uint64/from.js#L20)

Create Uint64 from bigint, number, or string

#### Parameters

##### value

bigint, number, or decimal/hex string

`string` | `number` | `bigint`

#### Returns

[`Uint64Type`](#uint64type)

Uint64 value

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

If value is out of range or invalid

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(100n);
const b = Uint64.from("18446744073709551615");
const c = Uint64.from("0xffffffffffffffff");
const d = Uint64.from(42);
```

***

### fromAbiEncoded()

> **fromAbiEncoded**(`bytes`): [`Uint64Type`](#uint64type)

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

Create Uint64 from ABI-encoded bytes (32 bytes, big-endian, left-padded)

#### Parameters

##### bytes

`Uint8Array`\<`ArrayBufferLike`>

ABI-encoded byte array (32 bytes)

#### Returns

[`Uint64Type`](#uint64type)

Uint64 value

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

If bytes length is not 32

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const abiBytes = new Uint8Array(32);
abiBytes[31] = 255;
const value = Uint64.fromAbiEncoded(abiBytes); // 255n
```

***

### fromBigInt()

> **fromBigInt**(`value`): [`Uint64Type`](#uint64type)

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

Create Uint64 from bigint

#### Parameters

##### value

`bigint`

bigint value

#### Returns

[`Uint64Type`](#uint64type)

Uint64 value

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

If value is out of range

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const value = Uint64.fromBigInt(100n);
```

***

### fromBytes()

> **fromBytes**(`bytes`): [`Uint64Type`](#uint64type)

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

Create Uint64 from bytes (big-endian, 8 bytes)

#### Parameters

##### bytes

`Uint8Array`\<`ArrayBufferLike`>

byte array (must be exactly 8 bytes)

#### Returns

[`Uint64Type`](#uint64type)

Uint64 value

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

If bytes length is not 8

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const bytes = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 255]);
const value = Uint64.fromBytes(bytes); // 255n
```

***

### fromHex()

> **fromHex**(`hex`): [`Uint64Type`](#uint64type)

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

Create Uint64 from hex string

#### Parameters

##### hex

`string`

hex string (with or without 0x prefix)

#### Returns

[`Uint64Type`](#uint64type)

Uint64 value

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

If value is out of range or invalid hex

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.fromHex("0xffffffffffffffff");
const b = Uint64.fromHex("ff");
```

***

### fromNumber()

> **fromNumber**(`value`): [`Uint64Type`](#uint64type)

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

Create Uint64 from number
WARNING: Values above Number.MAX\_SAFE\_INTEGER may lose precision

#### Parameters

##### value

`number`

number value

#### Returns

[`Uint64Type`](#uint64type)

Uint64 value

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

If value is out of range or invalid

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const value = Uint64.fromNumber(42);
```

***

### greaterThan()

> **greaterThan**(`uint`, `b`): `boolean`

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

Check if Uint64 value is greater than another

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

First value

##### b

[`Uint64Type`](#uint64type)

Second value

#### Returns

`boolean`

true if uint > b

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(200n);
const b = Uint64.from(100n);
const result = Uint64.greaterThan(a, b); // true
```

***

### isValid()

> **isValid**(`value`): `value is Uint64Type`

Defined in: [src/primitives/Uint64/isValid.js:19](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Uint64/isValid.js#L19)

Check if value is a valid Uint64

#### Parameters

##### value

`unknown`

Value to check

#### Returns

`value is Uint64Type`

true if valid Uint64

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const result1 = Uint64.isValid(100n); // true
const result2 = Uint64.isValid(-1n); // false
const result3 = Uint64.isValid(100); // false (must be bigint)
```

***

### isZero()

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

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

Check if Uint64 value is zero

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

Value to check

#### Returns

`boolean`

true if zero

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(0n);
const result = Uint64.isZero(a); // true
```

***

### leadingZeros()

> **leadingZeros**(`uint`): `number`

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

Count leading zeros in Uint64 value

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

Value

#### Returns

`number`

Number of leading zero bits

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(255n);
const result = Uint64.leadingZeros(a); // 56
```

***

### lessThan()

> **lessThan**(`uint`, `b`): `boolean`

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

Check if Uint64 value is less than another

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

First value

##### b

[`Uint64Type`](#uint64type)

Second value

#### Returns

`boolean`

true if uint \< b

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(100n);
const b = Uint64.from(200n);
const result = Uint64.lessThan(a, b); // true
```

***

### maximum()

> **maximum**(`uint`, `b`): [`Uint64Type`](#uint64type)

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

Return maximum of two Uint64 values

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

First value

##### b

[`Uint64Type`](#uint64type)

Second value

#### Returns

[`Uint64Type`](#uint64type)

Maximum value

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(100n);
const b = Uint64.from(200n);
const result = Uint64.maximum(a, b); // 200n
```

***

### minimum()

> **minimum**(`uint`, `b`): [`Uint64Type`](#uint64type)

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

Return minimum of two Uint64 values

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

First value

##### b

[`Uint64Type`](#uint64type)

Second value

#### Returns

[`Uint64Type`](#uint64type)

Minimum value

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(100n);
const b = Uint64.from(200n);
const result = Uint64.minimum(a, b); // 100n
```

***

### minus()

> **minus**(`uint`, `b`): [`Uint64Type`](#uint64type)

Defined in: [src/primitives/Uint64/minus.js:20](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Uint64/minus.js#L20)

Subtract Uint64 value with wrapping

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

First operand

##### b

[`Uint64Type`](#uint64type)

Second operand

#### Returns

[`Uint64Type`](#uint64type)

Difference (uint - b) mod 2^64

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(100n);
const b = Uint64.from(50n);
const diff = Uint64.minus(a, b); // 50n
```

***

### modulo()

> **modulo**(`uint`, `b`): [`Uint64Type`](#uint64type)

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

Modulo Uint64 value

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

Dividend

##### b

[`Uint64Type`](#uint64type)

Divisor

#### Returns

[`Uint64Type`](#uint64type)

Remainder (uint % b)

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

If divisor is zero

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(100n);
const b = Uint64.from(3n);
const remainder = Uint64.modulo(a, b); // 1n
```

***

### plus()

> **plus**(`uint`, `b`): [`Uint64Type`](#uint64type)

Defined in: [src/primitives/Uint64/plus.js:20](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Uint64/plus.js#L20)

Add Uint64 value with wrapping

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

First operand

##### b

[`Uint64Type`](#uint64type)

Second operand

#### Returns

[`Uint64Type`](#uint64type)

Sum (uint + b) mod 2^64

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(100n);
const b = Uint64.from(50n);
const sum = Uint64.plus(a, b); // 150n
```

***

### popCount()

> **popCount**(`uint`): `number`

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

Count set bits (population count) in Uint64 value

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

Value

#### Returns

`number`

Number of set bits

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(0b1111n);
const result = Uint64.popCount(a); // 4
```

***

### shiftLeft()

> **shiftLeft**(`uint`, `bits`): [`Uint64Type`](#uint64type)

Defined in: [src/primitives/Uint64/shiftLeft.js:19](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Uint64/shiftLeft.js#L19)

Left shift Uint64 value

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

Value to shift

##### bits

Number of bits to shift (0-63)

`number` | `bigint`

#### Returns

[`Uint64Type`](#uint64type)

Result (uint shifted left by bits) mod 2^64

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(1n);
const result = Uint64.shiftLeft(a, 8n); // 256n
```

***

### shiftRight()

> **shiftRight**(`uint`, `bits`): [`Uint64Type`](#uint64type)

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

Right shift Uint64 value (logical shift, zero-fill)

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

Value to shift

##### bits

Number of bits to shift (0-63)

`number` | `bigint`

#### Returns

[`Uint64Type`](#uint64type)

Result (uint shifted right by bits)

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(256n);
const result = Uint64.shiftRight(a, 8n); // 1n
```

***

### times()

> **times**(`uint`, `b`): [`Uint64Type`](#uint64type)

Defined in: [src/primitives/Uint64/times.js:20](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Uint64/times.js#L20)

Multiply Uint64 value with wrapping

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

First operand

##### b

[`Uint64Type`](#uint64type)

Second operand

#### Returns

[`Uint64Type`](#uint64type)

Product (uint \* b) mod 2^64

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.from(100n);
const b = Uint64.from(50n);
const product = Uint64.times(a, b); // 5000n
```

***

### toAbiEncoded()

> **toAbiEncoded**(`uint`): `Uint8Array`\<`ArrayBufferLike`>

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

Convert Uint64 to ABI-encoded bytes (32 bytes, big-endian, left-padded with zeros)

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

Uint64 value to convert

#### Returns

`Uint8Array`\<`ArrayBufferLike`>

32-byte Uint8Array

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const value = Uint64.from(255n);
const abiBytes = Uint64.toAbiEncoded(value);
```

***

### toBigInt()

> **toBigInt**(`uint`): `bigint`

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

Convert Uint64 to bigint

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

Uint64 value to convert

#### Returns

`bigint`

bigint value

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const value = Uint64.from(255n);
const bigintValue = Uint64.toBigInt(value); // 255n
```

***

### toBytes()

> **toBytes**(`uint`): `Uint8Array`\<`ArrayBufferLike`>

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

Convert Uint64 to bytes (big-endian, 8 bytes)

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

Uint64 value to convert

#### Returns

`Uint8Array`\<`ArrayBufferLike`>

8-byte Uint8Array

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const value = Uint64.from(255n);
const bytes = Uint64.toBytes(value);
```

***

### toHex()

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

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

Convert Uint64 to hex string (with 0x prefix)

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

Uint64 value to convert

#### Returns

`string`

hex string with 0x prefix

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const value = Uint64.from(255n);
const hex = Uint64.toHex(value); // "0xff"
```

***

### toNumber()

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

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

Convert Uint64 to number
WARNING: Values above Number.MAX\_SAFE\_INTEGER (9007199254740991) may lose precision

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

Uint64 value to convert

#### Returns

`number`

number value

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const value = Uint64.from(255n);
const num = Uint64.toNumber(value); // 255
```

***

### toPower()

> **toPower**(`uint`, `exp`): [`Uint64Type`](#uint64type)

Defined in: [src/primitives/Uint64/toPower.js:20](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Uint64/toPower.js#L20)

Raise Uint64 to power with wrapping

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

Base

##### exp

[`Uint64Type`](#uint64type)

Exponent

#### Returns

[`Uint64Type`](#uint64type)

Result (uint ^ exp) mod 2^64

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const base = Uint64.from(2n);
const exp = Uint64.from(10n);
const result = Uint64.toPower(base, exp); // 1024n
```

***

### toString()

> **toString**(`uint`): `string`

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

Convert Uint64 to string

#### Parameters

##### uint

[`Uint64Type`](#uint64type)

Uint64 value to convert

#### Returns

`string`

decimal string representation

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const value = Uint64.from(255n);
const str = Uint64.toString(value); // "255"
```

***

### tryFrom()

> **tryFrom**(`value`): [`Uint64Type`](#uint64type) | `null`

Defined in: [src/primitives/Uint64/tryFrom.js:19](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Uint64/tryFrom.js#L19)

Try to create Uint64 from value, return null if invalid

#### Parameters

##### value

`unknown`

Value to convert

#### Returns

[`Uint64Type`](#uint64type) | `null`

Uint64 value or null

#### See

[https://voltaire.tevm.sh/primitives/uint64](https://voltaire.tevm.sh/primitives/uint64) for Uint64 documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Uint64 from './primitives/Uint64/index.js';
const a = Uint64.tryFrom(100n); // 100n
const b = Uint64.tryFrom(-1n); // null
const c = Uint64.tryFrom("not a number"); // null
```
