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