Skip to content

Instantly share code, notes, and snippets.

@marlun
Created August 29, 2013 17:33
Show Gist options
  • Save marlun/6381023 to your computer and use it in GitHub Desktop.
Save marlun/6381023 to your computer and use it in GitHub Desktop.
var crypto = require('crypto')
var tar = require('tar')
var zlib = require('zlib')
var through = require('through')
var h = crypto.createHash('md5', { encoding: 'hex' })
var parser = tar.Parse()
parser.on('entry', function(e) {
if (e.type !== 'File') return
e.pipe(h).pipe(through(null, end)).pipe(process.stdout)
function end() { this.queue(' ' + e.path + '\n') }
})
var cipher = process.argv[2];
var pw = process.argv[3];
process.stdin
.pipe(crypto.createDecipher(cipher, pw))
.pipe(zlib.createGunzip())
.pipe(parser)
;
var crypto = require('crypto')
var tar = require('tar')
var zlib = require('zlib')
var through = require('through')
var parser = tar.Parse()
parser.on('entry', function(e) {
if (e.type !== 'File') return
var h = crypto.createHash('md5', { encoding: 'hex' })
e.pipe(h).pipe(through(null, end)).pipe(process.stdout)
function end() { this.queue(' ' + e.path + '\n') }
})
var cipher = process.argv[2];
var pw = process.argv[3];
process.stdin
.pipe(crypto.createDecipher(cipher, pw))
.pipe(zlib.createGunzip())
.pipe(parser)
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment