MCPcopy Index your code
hub / github.com/nodejs/node / generatePrimeSync

Function generatePrimeSync

lib/internal/crypto/random.js:538–546  ·  view source on GitHub ↗
(size, options = kEmptyObject)

Source from the content-addressed store, hash-verified

536}
537
538function generatePrimeSync(size, options = kEmptyObject) {
539 validateInt32(size, 'size', 1);
540
541 const job = createRandomPrimeJob(kCryptoJobSync, size, options);
542 const { 0: err, 1: prime } = job.run();
543 if (err)
544 throw err;
545 return job.result(prime);
546}
547
548/**
549 * 48 is the ASCII code for '0', 97 is the ASCII code for 'a'.

Callers 1

Calls 3

createRandomPrimeJobFunction · 0.85
runMethod · 0.45
resultMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…