mirror of
https://github.com/nodejs/node.git
synced 2024-11-24 20:29:23 +01:00
4cbcfaee9c
Signed-off-by: James M Snell <jasnell@gmail.com> Fixes: https://github.com/nodejs/node/issues/35722 PR-URL: https://github.com/nodejs/node/pull/35723 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Beth Griggs <bgriggs@redhat.com>
19 lines
393 B
JavaScript
19 lines
393 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const { randomFillSync } = require('crypto');
|
|
const { notStrictEqual } = 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');
|
|
|
|
notStrictEqual(before, after);
|