<commit_before># Yubico
Node library for validating Yubico One Time Passwords (OTPs) based on the [validation protocol version 2.0](http://code.google.com/p/yubikey-val-server-php/wiki/ValidationProtocolV20).

# Installation

    npm install yubico

# Usage

Create a new instance of the Yubico object and call `verify()` or `verify_multi()` method.

    var yubico = new Yubico(client_id, api_key, use_https)

Parameters:

* `client_id` - client id
* `key` - API key (optional)
* `use_https` true to use https (defaults to `true`)

Response message HMAC signature is only verified if an API key is provided so you are encouraged to provide it.

You can get both client_id and the api key at [https://upgrade.yubico.com/getapikey/](https://upgrade.yubico.com/getapikey/).

## Validating a single token

    yubico.verify(otp_token, timeout, callback)

Parameters:

* `otp` - token generated by the Yubikey
* `timeout` - connection timeout in seconds (defaults to 15 seconds)
* `callback` - a callback which is called with an error as the first argument if the Yubikey validation fails and `true` as the second one if the provided token is valid.<commit_msg>Add build status image to readme.<commit_after># Yubico
Node library for validating Yubico One Time Passwords (OTPs) based on the [validation protocol version 2.0](http://code.google.com/p/yubikey-val-server-php/wiki/ValidationProtocolV20).

# Installation

    npm install yubico

# Build Status

[![Build Status](https://secure.travis-ci.org/Kami/node-yubico.png)](http://travis-ci.org/Kami/node-yubico)

# Usage

Create a new instance of the Yubico object and call `verify()` or `verify_multi()` method.

    var yubico = new Yubico(client_id, api_key, use_https)

Parameters:

* `client_id` - client id
* `key` - API key (optional)
* `use_https` true to use https (defaults to `true`)

Response message HMAC signature is only verified if an API key is provided so you are encouraged to provide it.

You can get both client_id and the api key at [https://upgrade.yubico.com/getapikey/](https://upgrade.yubico.com/getapikey/).

## Validating a single token

    yubico.verify(otp_token, timeout, callback)

Parameters:

* `otp` - token generated by the Yubikey
* `timeout` - connection timeout in seconds (defaults to 15 seconds)
* `callback` - a callback which is called with an error as the first argument if the Yubikey validation fails and `true` as the second one if the provided token is valid.
{'fraction_non_alphanumeric': 0.09556730378202521, 'fraction_numerical': 0.004880032533550223, 'mean_word_length': 4.301724137931035, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 5, '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': '4680987', 'n_tokens_mistral': 779, 'n_tokens_neox': 751, 'n_words': 294}