Permalink
Browse files

add docs

  • Loading branch information...
tj committed Jun 27, 2012
1 parent 350bb4c commit 4f9496edf968a22394f8dfb88a5c44763cc7533f
Showing with 25 additions and 2 deletions.
  1. +25 −2 Readme.md
View
@@ -1,7 +1,30 @@
-# passhash
+# pwd
- Hash passwords
+ Hash and compare passwords with the crypto's pbkdf2.
+
+# Example
+
+On signup generate a salt / password hash, and save it somewhere:
+
+```js
+var pass = require('pwd');
+pass.hash('my password', function(err, salt, hash){
+ user.salt = salt;
+ user.hash = hash;
+})
+```
+
+To authenticate load and compare:
+
+```js
+var pass = require('pwd');
+pass.hash('submitted password', user.salt, function(err, hash){
+ if (user.hash == hash) {
+ // yay
+ }
+})
+```
## License

0 comments on commit 4f9496e

Please sign in to comment.