Skip to content

dominictarr/deterministic-tar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published