mirror of
https://github.com/nodejs/node.git
synced 2025-05-05 15:32:15 +00:00

Change var to const. PR-URL: https://github.com/nodejs/node/pull/10055 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
22 lines
483 B
JavaScript
22 lines
483 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
if (!common.hasCrypto) {
|
|
common.skip('missing crypto');
|
|
return;
|
|
}
|
|
|
|
const assert = require('assert');
|
|
const crypto = require('crypto');
|
|
|
|
const stream = require('stream');
|
|
const s = new stream.PassThrough();
|
|
const h = crypto.createHash('sha1');
|
|
const expect = '15987e60950cf22655b9323bc1e281f9c4aff47e';
|
|
|
|
s.pipe(h).on('data', common.mustCall(function(c) {
|
|
assert.strictEqual(c, expect);
|
|
})).setEncoding('hex');
|
|
|
|
s.end('aoeu');
|