Permalink
Browse files

Updated the readme to support recent hash changes.

Signed-off-by: Nick Campbell <nicholas.j.campbell@gmail.com>
  • Loading branch information...
1 parent 9f9bb50 commit c003f071a41d63bd6455e77e258671cc32f5fceb @ncb000gt committed Jun 27, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 README.md
View
11 README.md
@@ -74,6 +74,10 @@ To check a password:
bcrypt.compareSync("B4c0/\/", hash); // true
bcrypt.compareSync("not_bacon", hash); // false
+Auto-gen a salt and hash:
+
+ var hash = bcrypt.hashSync('bacon', 8)
+
Usage - Async
============
@@ -96,6 +100,11 @@ To check a password:
// res = false
});
+Auto-gen a salt and hash:
+
+ bcrypt.hash('bacon', 8, function(err, hash) {
+ });
+
API
============
@@ -115,7 +124,7 @@ API
* `salt` - [REQUIRED] - the salt to be used in encryption.
* `hash(data, salt, cb)`
* `data` - [REQUIRED] - the data to be encrypted.
- * `salt` - [REQUIRED] - the salt to be used in encryption.
+ * `salt` - [REQUIRED] - the salt to be used to hash the password. if specified as a number then a salt will be generated and used (see examples).
* `cb` - [REQUIRED] - a callback to be fired once the data has been encrypted. uses eio making it asynchronous.
* `err` - First parameter to the callback detailing any errors.
* `encrypted` - Second parameter to the callback providing the encrypted form.

0 comments on commit c003f07

Please sign in to comment.