It works for me in node REPL. Node v0.8.11, OSX lion 10.7.5 

Thanks,
Ruben Tan


On Friday, December 14, 2012 at 9:21 AM, Arunprabu Durairaju 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");
> 
> -- 
> 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] 
> (mailto:[email protected])
> To unsubscribe from this group, send email to
> [email protected] 
> (mailto:[email protected])
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
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

Reply via email to