Files: 1f9a3fcaa6f6fa4a3ad0a219f6df1a476588f6d5 / node_modules / pull-hash / ext / git.js
317 bytesRaw
1 | var hash = require('../') |
2 | |
3 | module.exports = function (object, encoding, onEnd) { |
4 | if (onEnd == null) onEnd = encoding, encoding = null |
5 | var hasher = hash('sha1', encoding || 'hex', onEnd) |
6 | var size = Number(object.length || object.size || 0) |
7 | hasher.hash.update(object.type + ' ' + size + '\0') |
8 | return hasher |
9 | } |
10 |
Built with git-ssb-web