public
Created

Hmac digest only returns a digest once?

  • Download Gist
gistfile1.js
JavaScript
1 2 3 4 5 6 7 8 9 10
crypto = require('crypto');
 
hmac = crypto.createHmac('sha256', 'hackme');
hmac.update('bladibla');
hmac.digest('hex'); // '6a405c5f6fe96680a57054cee8a4a74356c2df1b5e5cf8102dac3773af713418'
 
hmac.digest('hex'); // '' -- Hûh?!
 
hmac.update('bladibla');
hmac.digest('hex'); // '' -- Hûh?! Again?

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.