function hmac(key, string, encoding) {
return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding);
}
function hash(string, encoding) {
return crypto.createHash('sha256').update(string, 'utf8').digest(encoding);
}
For the above function hmac encoding is optional, or else it have value 'hex' I checked the OpenSsl library in ruby and found similar functions but not getting the same outputs when running in ruby.
Following link is used as reference to some extend but not exactly.Anyone have came across similar use case.Please let me know