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