0.2.0 • Published 6 years ago

deterministic-tar v0.2.0

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

deterministic-tar

generate/transform a tarball that hashes consistently.

strips out timestamps, user ids, and optional trailing null blocks.

Example

var http = require('https')
var deterministic = require('./')
var zlib = require('zlib')
var crypto = require('crypto')

var hash = crypto.createHash('sha256')

var url = 
  'https://codeload.github.com/dominictarr/deterministic-tar/tar.gz/master'

http.get(url, function (stream) {
  stream
    .pipe(zlib.createGunzip())

    // force the tarball to be deterministic!
    .pipe(deterministic())

    .on('data', function (data) {
      hash.update(data)
    })
    .on('end', function () {
      console.log(hash.digest('hex'))
    })
})

License

MIT

0.2.0

6 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.0

10 years ago