Created
August 29, 2013 17:33
-
-
Save marlun/6381023 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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