On Fri, Dec 14, 2012 at 2:21 AM, Arunprabu Durairaju <[email protected]> wrote: > I am trying to use crypt in my code to hash the password and getting the > following error. I have given the code in the bottom of this post. I am > using node version 0.8.16 on osx Lion 10.7.5. > > I tried searching for the issue and found couple of similar posts but > happening only on specific modules and they were old. > > crypto.js:138 > return (new Hmac).init(hmac, key); > ^ > TypeError: Not a string or buffer > at Object.exports.createHmac (crypto.js:138:21) > at addAdmin (/Users/apps//data_processor.js:37:26) > > Here is my code: > > var hashedpass = crypto.createHmac("sha1", > password).update('salttext').digest("hex");
The error message suggests `password` is neither a string or a buffer. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
