Closed KimlikDAO-bot closed 5 months ago
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
Thanks for the contribution!
Emit BigInt literals in hexadecimal format if it leads to shorter code size. This is important for cryptographic libraries, especially in verifiable computation, which have long list of large constants.
The exact threshold after which hexadecimal is shorter is 10^17, however to keep the code simple and extensible, we calculate both the decimal and hexadecimal encodings and compare their sizes.While both
f = (x) => x.toString(16).length + 2
andg = (x) => x.toString().length
are monotone, the difference of two monotone functions is not generally monotone. The above comment is incorrect, though the code is correct as is.