2 ms·
I saw this in the list referenced by https://news.ycombinator.com/item?id=28232369 https://news.ycombinator.com/item?id=28232369 as "(joke)". I tested it out.
by eesmith 5y ago
I saw this in the list referenced by https://news.ycombinator.com/item?id=28232369 https://news.ycombinator.com/item?id=28232369 as "(joke)".
I tested it out. Turns out to also be an API to test if a string is an integer (with optional leading +/-), because the range check occurs after the check for being an integer:
% curl https://api.isevenapi.xyz/api/iseven/999999/
{"ad":"FULL SIZE Mattress. Royal Tonic, 20 year warranty. Like new. Slight urine smell. $40, call 818-555-2301","iseven":false}
% curl https://api.isevenapi.xyz/api/iseven/1000000/
{"error":"Number out of range. Upgrade to isEven API Premium or Enterprise."}
% curl https://api.isevenapi.xyz/api/iseven/-2342342341412340/
{"error":"Number out of range. Upgrade to isEven API Premium or Enterprise."}
% curl https://api.isevenapi.xyz/api/iseven/-2342342341412340Q/
{"error":"Invalid number."}