mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
PR-URL: https://github.com/nodejs/node/pull/60498 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
19 lines
388 B
JavaScript
19 lines
388 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const { randomFillSync } = require('crypto');
|
|
const assert = require('assert');
|
|
|
|
const ab = new ArrayBuffer(20);
|
|
const buf = Buffer.from(ab, 10);
|
|
|
|
const before = buf.toString('hex');
|
|
|
|
randomFillSync(buf);
|
|
|
|
const after = buf.toString('hex');
|
|
|
|
assert.notStrictEqual(before, after);
|