Re:Why I no longer have an old-school cert on my HTTPS site
by jazzyjackson on Friday May 23, 2025 @05:02PM
(#44076572)
yes, python falls into the sane language category with arbitrary-precision arithmetic
[ Parent
| on HN ]
Re:Why I no longer have an old-school cert on my HTTPS site
by faresahmed on Friday May 23, 2025 @09:29PM
(#44078110)
Not so much,
>>> s="1"+"0"*4300
>>> json.loads(s)
...
ValueError: Exceeds the limit (4300 digits) for integer string conversion:
value has 4301 digits; use sys.set_int_max_str_digits() to increase the limit
This was done to prevent DoS attacks 3 years ago and have been backported to at least CPython 3.9 as it was considered a CVE.Relevant discussion: https://news.ycombinator.com/item?id=32753235
Your sibling comment suggests using decimal.Decimal which handles parsing >4300 digit numbers (by default).
Re:Why I no longer have an old-school cert on my HTTPS site
by lifthrasiir on Saturday May 24, 2025 @12:37AM
(#44078814)
This should be interpreted as a stop-gap measure before a subquadratic algorithm can be adopted. Take a look at _pylong.py in new enough CPython.