# secure-compare

> Securely compare two strings, copied from cryptiles

Latest version **3.0.1** (published 2015-03-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install secure-compare
pnpm add secure-compare
yarn add secure-compare
bun add secure-compare
```

## 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 | 3.0.1 |
| Published | 2015-03-30 |
| First published | 2014-12-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 48 |
| Author | Vadim Demedes |
| Maintainers | vdemedes |
| Keywords | secure, compare |

## Links

- npm: https://www.npmjs.com/package/secure-compare
- Repository: https://github.com/vdemedes/secure-compare
- Issues: https://github.com/vdemedes/secure-compare/issues
- npm.io page: https://npm.io/package/secure-compare

## Recent versions

- 3.0.1 (latest) — 2015-03-30
- 0.9.0 — 2014-12-13

## README

# secure-compare

Constant-time comparison algorithm to prevent timing attacks for Node.js.
Copied from [cryptiles](https://github.com/hapijs/cryptiles) by [C J Silverio](https://github.com/ceejbot).


### Installation

```
$ npm install secure-compare --save
```


### Usage

```javascript
var compare = require('secure-compare');

compare('hello world', 'hello world').should.equal(true);
compare('你好世界', '你好世界').should.equal(true);

compare('hello', 'not hello').should.equal(false);
```


### Tests

```
$ npm test
```


### License

secure-compare is released under the MIT license.

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