mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
This test fails prior to 990feafcb6 being cherry-picked
due to stream.pipeline with a crypto.Hash not working properly.
That bug also seems to have affected md5.
PR-URL: https://github.com/nodejs/node/pull/37009
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
22 lines
505 B
JavaScript
22 lines
505 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const assert = require('assert');
|
|
const crypto = require('crypto');
|
|
const stream = require('stream');
|
|
|
|
const hash = crypto.createHash('md5');
|
|
const s = new stream.PassThrough();
|
|
const expect = 'e8dc4081b13434b45189a720b77b6818';
|
|
|
|
s.write('abcdefgh');
|
|
stream.pipeline(s, hash, common.mustCall(function(err) {
|
|
assert.ifError(err);
|
|
assert.strictEqual(hash.digest('hex'), expect);
|
|
}));
|
|
s.end();
|