var hash = require('../')

module.exports = function (object, encoding, onEnd) {
  if (onEnd == null) onEnd = encoding, encoding = null
  var hasher = hash('sha1', encoding || 'hex', onEnd)
  hasher.hash.update(object.type + ' ' + (object.length || object.size) + '\0')
  return hasher
}
