0

I want to generate a signature in Node.js. Here is a python example:

signature = hmac.new(SECRET, msg=message, digestmod=hashlib.sha256).hexdigest().upper()

I have this:

signature = crypto.createHmac('sha256', SECRET).update(message).digest('hex').toUpperCase()

What am I doing wrong?

John Russell
  • 1,115
  • 1
  • 15
  • 30

1 Answers1

0

Checked the node manuals as well. It looks correct to me. What about the ; in the end of the chain?

georgez
  • 737
  • 1
  • 8
  • 20
  • Ha ok! Just saying :) – georgez Sep 24 '13 at 23:29
  • How embarrasing. I just checked the two: Python: http://ideone.com/jXYqa5 Node: http://ideone.com/y4QBpB They are, in fact, the same. Which means I must be doing something else wrong with the API I am integrating with. Thanks for the vote of confidence. :) – John Russell Sep 24 '13 at 23:33