# @pacote/u64

> Unsigned 64-bit integers.

Latest version **0.3.2** (published 2026-10-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @pacote/u64
pnpm add @pacote/u64
yarn add @pacote/u64
bun add @pacote/u64
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2026-10-08 |
| First published | 2021-02-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 110.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 20 |
| Author | Luís Rodrigues |
| Maintainers | goblindegook |

## Links

- npm: https://www.npmjs.com/package/@pacote/u64
- Repository: https://github.com/PacoteJS/pacote
- Homepage: https://github.com/PacoteJS/pacote#readme
- Issues: https://github.com/PacoteJS/pacote/issues
- npm.io page: https://npm.io/package/@pacote/u64

## Recent versions

- 0.3.2 (latest) — 2026-10-08
- 0.3.1 — 2026-04-01
- 0.3.0 — 2026-03-31
- 0.2.3 — 2024-10-05
- 0.2.2 — 2023-08-25
- 0.2.1 — 2023-04-22
- 0.2.0 — 2023-04-13
- 0.1.8 — 2022-09-02
- 0.1.6 — 2021-10-23
- 0.1.5 — 2021-08-13
- 0.1.4 — 2021-02-26
- 0.1.3 — 2021-02-14
- 0.1.2 — 2021-02-12
- 0.1.1 — 2021-02-09
- 0.1.0 — 2021-02-06

## README

# @pacote/u64

![version](https://badgen.net/npm/v/@pacote/u64)
![minified](https://badgen.net/bundlephobia/min/@pacote/u64)
![minified + gzip](https://badgen.net/bundlephobia/minzip/@pacote/u64)

Unsigned 64-bit integers.

This package exists because while modern JavaScript environments support very
large integers via the [`BigInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)
type, it is not available in older browsers and tooling doesn't always
transpile `BigInt` operations into a backwards-compatible format.

`U64` also turned out to be more performant than `BigInt` in tests. `@pacote`'s
implementation of the XXH64 algorithm based on `U64` is 4.5 times faster than
the one based on `BigInt`, although optimizations to JavaScript runtimes might
change this in the future.

If you target ECMAScript 2020 or later, and you do not care about the
differences in performance, you will _probably_ not need this.

The `U64` type provided by this package is represented as a tuple of four 16-bit
integers. For example, the number 1 is `[1, 0, 0, 0]`. It is not an object class
with built-in methods. Instead of methods, the package provides functions to
support commonly-used operations.

## Installation

```bash
yarn add @pacote/u64
```

## Example

```typescript
import { add, from, toString } from '@pacote/u64'

const result = add(from('1609587929392839161'), from('9650029242287828579'))

toString(result) // -> '11259617171680667740'
```

## License

MIT © [Luís Rodrigues](https://goblindegook.com).

---
_Source: https://npm.io/package/@pacote/u64 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
