/** * SPDX-License-Identifier: CC0-1.0 * * Copyright (C) 2026 Woj. Kosior */ /* #+begin_src manifest-jq .matches = [""] #+end_src */ /* * This is a counting schemes definition for use with `pow-solver.js'. It is * used by multiple content scripts. */ const appendedNumberCountingSchemes = (() => { const ascii0 = 48; const ascii9 = 57; function stepArray(array, by) { let idx = array.length - 1; while (true) { const byte = array[idx] += by; if (byte > ascii9) { array[idx] = ascii0; by = 1; } else if (byte < ascii0) { array[idx] = ascii9; by = -1; } else { break; } idx--; } } return [ /* * In Anubis, server parses suffix as Int which might be a signed 32-bit * type. */ { makeArray: randomData => randomData + '2147483647', stepArray: array => stepArray(array, -1), suffixLength: () => '2147483647'.length }, { makeArray: randomData => randomData + '1000000000', stepArray: array => stepArray(array, 1), suffixLength: () => '1000000000'.length } ]; })();