문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top