(input)
| 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. |
| 801 | function 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 | |
| 814 | function bigIntArrayToUnsignedBigInt(input) { |
| 815 | let result = 0n; |
no outgoing calls
no test coverage detected
searching dependent graphs…