|
|
@ -189,16 +189,20 @@ Hash.prototype.digest = function(outputEncoding) { |
|
|
|
|
|
|
|
exports.createHmac = exports.Hmac = Hmac; |
|
|
|
|
|
|
|
function Hmac(hmac, key) { |
|
|
|
function Hmac(hmac, key, options) { |
|
|
|
if (!(this instanceof Hmac)) |
|
|
|
return new Hmac(hmac, key); |
|
|
|
this._binding = new binding.Hmac(); |
|
|
|
this._binding.init(hmac, toBuf(key)); |
|
|
|
stream.Transform.call(this, options); |
|
|
|
} |
|
|
|
|
|
|
|
util.inherits(Hmac, stream.Transform); |
|
|
|
|
|
|
|
Hmac.prototype.update = Hash.prototype.update; |
|
|
|
Hmac.prototype.digest = Hash.prototype.digest; |
|
|
|
Hmac.prototype._flush = Hash.prototype._flush; |
|
|
|
Hmac.prototype._transform = Hash.prototype._transform; |
|
|
|
|
|
|
|
|
|
|
|
function getDecoder(decoder, encoding) { |
|
|
|