File size: 604 Bytes
05a77ff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# 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.