xref: /third_party/node/test/addons/openssl-binding/test.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/addons/openssl-binding/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ciconst common = require('../../common');
41cb0ef41Sopenharmony_ciif (!common.hasCrypto)
51cb0ef41Sopenharmony_ci  common.skip('missing crypto');
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ciconst assert = require('assert');
81cb0ef41Sopenharmony_ciconst binding = require(`./build/${common.buildType}/binding`);
91cb0ef41Sopenharmony_ciconst bytes = new Uint8Array(1024);
101cb0ef41Sopenharmony_ciassert(binding.randomBytes(bytes));
111cb0ef41Sopenharmony_ciassert(bytes.reduce((v, a) => v + a) > 0);
121cb0ef41Sopenharmony_ciassert(binding.hash(bytes));
13

Indexes created Thu Nov 07 10:32:03 CST 2024