mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 17:01:08 +00:00

PR-URL: https://github.com/nodejs/node/pull/45486 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
13 lines
354 B
JavaScript
13 lines
354 B
JavaScript
'use strict';
|
|
|
|
const common = require('../../common');
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const assert = require('assert');
|
|
const binding = require(`./build/${common.buildType}/binding`);
|
|
const bytes = new Uint8Array(1024);
|
|
assert(binding.randomBytes(bytes));
|
|
assert(bytes.reduce((v, a) => v + a) > 0);
|
|
assert(binding.hash(bytes));
|