Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Tencho Tenev committed Feb 8, 2015
1 parent 14837ef commit 87773b9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,15 @@ __Arguments__
* `next(err, isVeified)` - A callback which is called after the comparison has finished.
<a name="set" />
### set(value, hashField, next)
### set(value, hashField, [saltIterations], next)
Hasheh the given value using bcrypt's `genSalt` and `hash` and assigns it to `this[hashField]`.
__Arguments__
* `value` - The plain value to hash.
* `hashField` - The name of the property to be set.
* `saltIterations` - Optional. A parameter passed to `bcrypt.genSalt`. Defaults to 10.
* `next(err)` - A callback which is called after hashing has finished.
<a name="setEncryption" />
Expand All @@ -110,6 +111,7 @@ __Arguments__
- `field` - The name of the field to be encrypted
- `verify` - The name of the verify method attached as an instance method on the `schema.methods`
- `set` - The name of the set method attached as an instance method on the `schema.methods`
- `saltIterations` - A parameter passed to `bcrypt.genSalt`. Defaults to 10
__Example__
Expand All @@ -123,7 +125,8 @@ var mongoose = require('mongoose'),
schema.plugin(encryption, {
field: 'password',
verify: 'customVerifyName',
set: 'customSetName'
set: 'customSetName',
saltIterations: 100
})
```
Expand Down

0 comments on commit 87773b9

Please sign in to comment.