Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Jun 27, 2012
1 parent 350bb4c commit 4f9496e
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions Readme.md
@@ -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

Expand Down

0 comments on commit 4f9496e

Please sign in to comment.