MCPcopy Create free account
hub / github.com/diffusionstudio/vits-web / initRandomFill

Function initRandomFill

src/piper.js:1241–1256  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1239 join2: (l, r) => PATH.normalize(l + '/' + r),
1240 };
1241 var initRandomFill = () => {
1242 if (typeof crypto == 'object' && typeof crypto['getRandomValues'] == 'function') {
1243 return (view) => crypto.getRandomValues(view);
1244 } else if (ENVIRONMENT_IS_NODE) {
1245 try {
1246 var crypto_module = require('crypto');
1247 var randomFillSync = crypto_module['randomFillSync'];
1248 if (randomFillSync) {
1249 return (view) => crypto_module['randomFillSync'](view);
1250 }
1251 var randomBytes = crypto_module['randomBytes'];
1252 return (view) => (view.set(randomBytes(view.byteLength)), view);
1253 } catch (e) {}
1254 }
1255 abort('initRandomDevice');
1256 };
1257 var randomFill = (view) => (randomFill = initRandomFill())(view);
1258 var PATH_FS = {
1259 resolve: function () {

Callers 1

randomFillFunction · 0.85

Calls 1

abortFunction · 0.85

Tested by

no test coverage detected