<commit_before># Deprecated

[It's included in Node.js 6.6.0 and later.](https://nodejs.org/api/crypto.html#crypto_crypto_timingsafeequal_a_b)

---

# buffer-equals-constant [![Build Status](https://travis-ci.org/sindresorhus/buffer-equals-constant.svg?branch=master)](https://travis-ci.org/sindresorhus/buffer-equals-constant)

> Check if two buffers have the same bytes in [constant time](https://en.wikipedia.org/wiki/Timing_attack)


## Install

```
$ npm install buffer-equals-constant
```


## Usage

```js
const bufferEqualsConstant = require('buffer-equals-constant');

bufferEqualsConstant(new Buffer('foo'), new Buffer('foo'));
//=> true

bufferEqualsConstant(new Buffer('foo'), new Buffer('bar'));
//=> false

bufferEqualsConstant(new Buffer('foo'), new Buffer('foo'), 512);
//=> true
```
<commit_msg>Tweak deprecation notice<commit_after># Deprecated

It was added to Node.js 6.6.0 as [`crypto.timingSafeEqual()`](https://nodejs.org/api/crypto.html#crypto_crypto_timingsafeequal_a_b).

---

# buffer-equals-constant [![Build Status](https://travis-ci.org/sindresorhus/buffer-equals-constant.svg?branch=master)](https://travis-ci.org/sindresorhus/buffer-equals-constant)

> Check if two buffers have the same bytes in [constant time](https://en.wikipedia.org/wiki/Timing_attack)


## Install

```
$ npm install buffer-equals-constant
```


## Usage

```js
const bufferEqualsConstant = require('buffer-equals-constant');

bufferEqualsConstant(new Buffer('foo'), new Buffer('foo'));
//=> true

bufferEqualsConstant(new Buffer('foo'), new Buffer('bar'));
//=> false

bufferEqualsConstant(new Buffer('foo'), new Buffer('foo'), 512);
//=> true
```

{'fraction_non_alphanumeric': 0.1777509068923821, 'fraction_numerical': 0.007255139056831923, 'mean_word_length': 5.646586345381526, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2159882', 'n_tokens_mistral': 555, 'n_tokens_neox': 524, 'n_words': 99}