<commit_before># node-argon2 [![NPM package][npm-image]][npm-url] [![Build status][travis-image]][travis-url] [![Coverage status][coverage-image]][coverage-url] [![Code Quality][codequality-image]][codequality-url] [![Dependencies][david-dm-image]][david-dm-url]
Bindings to the reference [Argon2](https://github.com/P-H-C/phc-winner-argon2)
implementation.

### Before installing
You **MUST** have a **node-gyp** global install before proceeding with install.
**node-argon2** works only and is tested against Node >=4.0.0 .

### Usage
It's possible to hash a password using both Argon2i (default) and Argon2d, sync
and async, and to verify if a password matches a hash, and also generate random
cryptographically-safe salts. Salts **must** be at least 8-byte long buffers.

To hash a password:
```js
const argon2 = require('argon2');
const salt = new Buffer('somesalt');

argon2.hash('password', salt).then(hash => {
  // ...
}).catch(err => {
  // ...
});

// OR
<commit_msg>Adding compiler instructions to readme for OSX.<commit_after># node-argon2 [![NPM package][npm-image]][npm-url] [![Build status][travis-image]][travis-url] [![Coverage status][coverage-image]][coverage-url] [![Code Quality][codequality-image]][codequality-url] [![Dependencies][david-dm-image]][david-dm-url]
Bindings to the reference [Argon2](https://github.com/P-H-C/phc-winner-argon2)
implementation.

### Before installing
You **MUST** have a **node-gyp** global install before proceeding with install,
along with GCC >= 4.8 / Clang >= 3.3.

**node-argon2** works only and is tested against Node >=4.0.0.

#### OSX

To install GCC >= 4.8 on OSX, use [homebrew](http://brew.sh/):

```console
$ brew install gcc
```

Once you've got GCC installed and ready to run, you then need to install
node-gyp, you must do this globally:

```console
$ npm install -g node-gyp
```

Finally, once node-gyp is installed and ready to go, you can install this
library, specifying the GCC or Clang binary to use:

```console
$ CXX=g++-5 npm install argon2
```

**NOTE**: If your GCC or Clang binary is named something different than `g++-5`,
you'll need to specify that in the command.

### Usage
It's possible to hash a password using both Argon2i (default) and Argon2d, sync
and async, and to verify if a password matches a hash, and also generate random
cryptographically-safe salts. Salts **must** be at least 8-byte long buffers.

To hash a password:
```js
const argon2 = require('argon2');
const salt = new Buffer('somesalt');

argon2.hash('password', salt).then(hash => {
  // ...
}).catch(err => {
  // ...
});

// OR

{'fraction_non_alphanumeric': 0.1580370942812983, 'fraction_numerical': 0.013523956723338485, 'mean_word_length': 4.555793991416309, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, 'https://': 2, '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': '6972156', 'n_tokens_mistral': 893, 'n_tokens_neox': 843, 'n_words': 286}