Skip to content

Commit

Permalink
added Travis-CI build status and David dependency status badges to th…
Browse files Browse the repository at this point in the history
…e readme
  • Loading branch information
nisaacson committed Mar 19, 2013
1 parent 1bb6bf1 commit a49aa90
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 32 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: node_js
node_js:
- "0.6"
- "0.8"
- "0.10"
66 changes: 34 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
bcrypt-nodejs
# bcrypt-nodejs
===========================================

[![build status](https://secure.travis-ci.org/shaneGirish/bcrypt-nodejs)](http://travis-ci.org/shaneGirish/bcrypt-nodejs) [![Dependency Status](https://david-dm.org/shaneGirish/bcrypt-nodejs)](https://david-dm.org/shaneGirish/bcrypt-nodejs)
Warning : A change was made in v0.0.3 to allow encoding of UTF-8 encoded strings. This causes strings encoded in v0.0.2 or earlier to not work in v0.0.3 anymore.

Native JS implementation of BCrypt for Node.
Expand All @@ -12,7 +12,7 @@ Basically, to deploy one of my apps which uses [node.bcrypt.js] on a winx64 plat

This code is based on [javascript-bcrypt] and uses [crypto] (http://nodejs.org/api/crypto.html) to create random byte arrays.

Basic usage:
# Basic usage:
-----------
Synchronous
```
Expand All @@ -25,7 +25,7 @@ bcrypt.compareSync("veggies", hash); // false
Asynchronous
```
bcrypt.hash("bacon", null, null, function(err, hash) {
// Store hash in your password DB.
// Store hash in your password DB.
});
// Load hash from your password DB.
Expand All @@ -40,45 +40,46 @@ bcrypt.compare("veggies", hash, function(err, res) {
In the above examples, the salt is automatically generated and attached to the hash.
Though you can use your custom salt and there is no need for salts to be persisted as it will always be included in the final hash result and can be retrieved.

API
# API
-------------------------
* `genSaltSync(rounds)`
* `rounds` - [OPTIONAL] - the number of rounds to process the data for. (default - 10)
* `rounds` - [OPTIONAL] - the number of rounds to process the data for. (default - 10)
* `genSalt(rounds, callback)`
* `rounds` - [OPTIONAL] - the number of rounds to process the data for. (default - 10)
* `callback` - [REQUIRED] - a callback to be fired once the salt has been generated.
* `error` - First parameter to the callback detailing any errors.
* `result` - Second parameter to the callback providing the generated salt.
* `rounds` - [OPTIONAL] - the number of rounds to process the data for. (default - 10)
* `callback` - [REQUIRED] - a callback to be fired once the salt has been generated.
* `error` - First parameter to the callback detailing any errors.
* `result` - Second parameter to the callback providing the generated salt.
* `hashSync(data, salt)`
* `data` - [REQUIRED] - the data to be encrypted.
* `salt` - [REQUIRED] - the salt to be used in encryption.
* `data` - [REQUIRED] - the data to be encrypted.
* `salt` - [REQUIRED] - the salt to be used in encryption.
* `hash(data, salt, progress, cb)`
* `data` - [REQUIRED] - the data to be encrypted.
* `salt` - [REQUIRED] - the salt to be used to hash the password.
* `progress` - a callback to be called during the hash calculation to signify progress
* `callback` - [REQUIRED] - a callback to be fired once the data has been encrypted.
* `error` - First parameter to the callback detailing any errors.
* `result` - Second parameter to the callback providing the encrypted form.
* `data` - [REQUIRED] - the data to be encrypted.
* `salt` - [REQUIRED] - the salt to be used to hash the password.
* `progress` - a callback to be called during the hash calculation to signify progress
* `callback` - [REQUIRED] - a callback to be fired once the data has been encrypted.
* `error` - First parameter to the callback detailing any errors.
* `result` - Second parameter to the callback providing the encrypted form.
* `compareSync(data, encrypted)`
* `data` - [REQUIRED] - data to compare.
* `encrypted` - [REQUIRED] - data to be compared to.
* `data` - [REQUIRED] - data to compare.
* `encrypted` - [REQUIRED] - data to be compared to.
* `compare(data, encrypted, cb)`
* `data` - [REQUIRED] - data to compare.
* `encrypted` - [REQUIRED] - data to be compared to.
* `callback` - [REQUIRED] - a callback to be fired once the data has been compared.
* `error` - First parameter to the callback detailing any errors.
* `result` - Second parameter to the callback providing whether the data and encrypted forms match [true | false].
* `data` - [REQUIRED] - data to compare.
* `encrypted` - [REQUIRED] - data to be compared to.
* `callback` - [REQUIRED] - a callback to be fired once the data has been compared.
* `error` - First parameter to the callback detailing any errors.
* `result` - Second parameter to the callback providing whether the data and encrypted forms match [true | false].
* `getRounds(encrypted)` - return the number of rounds used to encrypt a given hash
* `encrypted` - [REQUIRED] - hash from which the number of rounds used should be extracted.
Contributors
* `encrypted` - [REQUIRED] - hash from which the number of rounds used should be extracted.

# Contributors
============

* [Alex Murray][alexmurray]
* [Nicolas Pelletier][NicolasPelletier]
* [Josh Rogers][geekymole]

Credits
* [Josh Rogers][geekymole]
* [Noah Isaacson][nisaacson]

# Credits
-------------------------
I heavily reused code from [javascript-bcrypt]. Though "Clipperz Javascript Crypto Library" was removed and its functionality replaced with "crypto".

Expand All @@ -87,4 +88,5 @@ I heavily reused code from [javascript-bcrypt]. Though "Clipperz Javascript Cryp

[alexmurray]:https://github.com/alexmurray
[NicolasPelletier]:https://github.com/NicolasPelletier
[geekymole]:https://github.com/geekymole
[geekymole]:https://github.com/geekymole
[nisaacson]:https://github.com/nisaacson

0 comments on commit a49aa90

Please sign in to comment.