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