# buffer-equal-constant-time

> Constant-time comparison of Buffers

Latest version **1.0.1** (published 2013-12-16) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install buffer-equal-constant-time
pnpm add buffer-equal-constant-time
yarn add buffer-equal-constant-time
bun add buffer-equal-constant-time
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2013-12-16 |
| First published | 2013-12-16 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | GoInstant Inc., a salesforce.com company |
| Maintainers | goinstant |
| Keywords | buffer, equal, constant-time, crypto |

## Links

- npm: https://www.npmjs.com/package/buffer-equal-constant-time
- Repository: git@github.com:goinstant/buffer-equal-constant-time
- Issues: https://github.com/goinstant/buffer-equal-constant-time/issues
- npm.io page: https://npm.io/package/buffer-equal-constant-time

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2013-12-16
- 1.0.0 — 2013-12-16

## README

# buffer-equal-constant-time

Constant-time `Buffer` comparison for node.js.  Should work with browserify too.

[![Build Status](https://travis-ci.org/goinstant/buffer-equal-constant-time.png?branch=master)](https://travis-ci.org/goinstant/buffer-equal-constant-time)

```sh
  npm install buffer-equal-constant-time
```

# Usage

```js
  var bufferEq = require('buffer-equal-constant-time');

  var a = new Buffer('asdf');
  var b = new Buffer('asdf');
  if (bufferEq(a,b)) {
    // the same!
  } else {
    // different in at least one byte!
  }
```

If you'd like to install an `.equal()` method onto the node.js `Buffer` and
`SlowBuffer` prototypes:

```js
  require('buffer-equal-constant-time').install();

  var a = new Buffer('asdf');
  var b = new Buffer('asdf');
  if (a.equal(b)) {
    // the same!
  } else {
    // different in at least one byte!
  }
```

To get rid of the installed `.equal()` method, call `.restore()`:

```js
  require('buffer-equal-constant-time').restore();
```

# Legal

&copy; 2013 GoInstant Inc., a salesforce.com company

Licensed under the BSD 3-clause license.

---
_Source: https://npm.io/package/buffer-equal-constant-time · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
