Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Secretz is expecting a weird result #324

Closed
CamiloMM opened this issue Jun 8, 2014 · 3 comments
Closed

Secretz is expecting a weird result #324

CamiloMM opened this issue Jun 8, 2014 · 3 comments

Comments

@CamiloMM
Copy link

CamiloMM commented Jun 8, 2014

I think the expected result of secretz is wrong:
console screenshot

So while my format is

MD5_1 PATH_1
MD5_2 PATH_2

It seems to weirdly expect

MD5_1MD5_2 PATH_1
 PATH_2

I'm on Win7 x64 and stream-adventure@2.4.3, npm@1.4.13, node@v0.11.13.

In case my code triggered this bug, here's what it was:

var crypto = require('crypto');
var zlib = require('zlib');
var tar = require('tar');
var through = require('through');

var decipher = crypto.createDecipher(process.argv[2], process.argv[3]);
var gunzip = zlib.createGunzip();
var parser = tar.Parse();

parser.on('entry', function(entry) {
    if (entry.type !== 'File') return;
    var hasher = crypto.createHash('md5', { encoding: 'hex' });
    entry.pipe(hasher).pipe(through(function(md5) {
        console.log(md5 + ' ' + entry.path);
    }));
});

process.stdin
    .pipe(decipher)
    .pipe(gunzip)
    .pipe(parser);
@finnp
Copy link
Member

finnp commented Aug 24, 2014

Hello @CamiloMM,

your solution worked on my computer with the newest version. Can you update it with npm install stream-adventure -g and try again? I think it might be a Windows newline problem.

Best,
Finn

@jedireza
Copy link
Member

jedireza commented Feb 7, 2015

I got some similar results. Node 0.12 failed but node 0.10 passes.

$ npm version
{ npm: '2.5.1',
  http_parser: '2.3',
  modules: '14',
  node: '0.12.0',
  openssl: '1.0.1l',
  uv: '1.0.2',
  v8: '3.28.73',
  zlib: '1.2.8' }
$ ./node_modules/.bin/stream-adventure verify ./stream-adventure/15-secretz.js
ACTUAL:   "97911dcc607865d621029f6f927c7851 secretz/METADATA.TXT"
EXPECTED: "97911dcc607865d621029f6f927c78512cdcfa9f8bbefb82fb7a894964b5c199 secretz/METADATA.TXT"

ACTUAL:   "2cdcfa9f8bbefb82fb7a894964b5c199 secretz/SPYING.TXT"
EXPECTED: " secretz/SPYING.TXT"

ACTUAL:   ""
EXPECTED: ""

# FAIL

Then I switched to node 0.10

$ npm version
{ http_parser: '1.0',
  node: '0.10.36',
  v8: '3.14.5.9',
  ares: '1.9.0-DEV',
  uv: '0.10.30',
  zlib: '1.2.8',
  modules: '11',
  openssl: '1.0.1l',
  npm: '1.4.28' }
$ ./node_modules/.bin/stream-adventure verify ./stream-adventure/15-secretz.js
ACTUAL:   "97911dcc607865d621029f6f927c7851 secretz/METADATA.TXT"
EXPECTED: "97911dcc607865d621029f6f927c7851 secretz/METADATA.TXT"

ACTUAL:   "2cdcfa9f8bbefb82fb7a894964b5c199 secretz/SPYING.TXT"
EXPECTED: "2cdcfa9f8bbefb82fb7a894964b5c199 secretz/SPYING.TXT"

ACTUAL:   ""
EXPECTED: ""

# PASS

@Sequoia
Copy link
Member

Sequoia commented Feb 20, 2015

migrated this to stream-adventure repo workshopper/stream-adventure#114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants