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

Function bigIntArrayToUnsignedInt

lib/internal/crypto/util.js:801–812  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

799// https://github.com/chromium/chromium/blob/HEAD/third_party/blink/public/platform/web_crypto_algorithm_params.h, but ported to JavaScript
800// Returns undefined if the conversion was unsuccessful.
801function bigIntArrayToUnsignedInt(input) {
802 let result = 0;
803
804 for (let n = 0; n < input.length; ++n) {
805 const n_reversed = input.length - n - 1;
806 if (n_reversed >= 4 && input[n])
807 return; // Too large
808 result |= input[n] << 8 * n_reversed;
809 }
810
811 return result >>> 0;
812}
813
814function bigIntArrayToUnsignedBigInt(input) {
815 let result = 0n;

Callers 2

rsaKeyGenerateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…