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

Function unsignedBigIntToBuffer

lib/internal/crypto/random.js:574–582  ·  view source on GitHub ↗
(bigint, name)

Source from the content-addressed store, hash-verified

572}
573
574function unsignedBigIntToBuffer(bigint, name) {
575 if (bigint < 0) {
576 throw new ERR_OUT_OF_RANGE(name, '>= 0', bigint);
577 }
578
579 const hex = BigIntPrototypeToString(bigint, 16);
580 const padded = StringPrototypePadStart(hex, hex.length + (hex.length % 2), 0);
581 return Buffer.from(padded, 'hex');
582}
583
584function checkPrime(candidate, options = kEmptyObject, callback) {
585 if (typeof candidate === 'bigint')

Callers 3

createRandomPrimeJobFunction · 0.85
checkPrimeFunction · 0.85
checkPrimeSyncFunction · 0.85

Calls 1

fromMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…