git ssb

0+

cel / pull-git-remote-helper



Tree: b1ed4631de0942640e4c7591c2be9dbdf8e98240

Files: b1ed4631de0942640e4c7591c2be9dbdf8e98240 / 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