you don't need an if-statement with an else branch here... would you consider rewriting it to:
```javascript
if (err)
    return cbdigest(err);
cbdigest(null, doc && doc.password);
```

?