git ssb

0+

cel / pull-git-remote-helper



Tree: f60f57ddecf31964b98f5147c7ee02faa6c871fc

Files: f60f57ddecf31964b98f5147c7ee02faa6c871fc / util.js

464 bytesRaw
1var crypto = require('crypto')
2var pull = require('pull-stream')
3
4exports.createHash = function (type) {
5 var hash = crypto.createHash(type)
6 var hasher = pull.through(hash.update.bind(hash))
7 hasher.hash = hash
8 hasher.digest = hash.digest.bind(hash)
9 return hasher
10}
11
12exports.createGitObjectHash = function (objectType, objectLength) {
13 var hasher = exports.createHash('sha1')
14 hasher.hash.update(objectType + ' ' + objectLength + '\0')
15 return hasher
16}
17

Built with git-ssb-web