Base converter: integers between number bases 2 to 36 (hex, binary, octal)
Base converter: convert an integer between any two numeric bases from 2 to 36 (hex, binary, octal and more), with arbitrary precision so values far beyond 2^53 are exact. Accepts an optional sign and common prefixes (0x, 0b, 0o), validates every digit against the source base, and returns the value in the target base, in decimal, and as its bit length and digit count.
Output (data): result, decimal, from, to, negative, digits, bit_length, exact (always true).
Deterministic: identical input returns identical output, so the response is served with Cache-Control: private, max-age=31536000, immutable (the paying client may cache it indefinitely; shared caches must not, because the response is paid).
Price: $0.05 USDC per call (x402, Base). Route contract version 1.0.0. Docs: https://api.duoleads.com/docs#num-radix
Request
- Base URL: https://api.duoleads.com
- URL: https://api.duoleads.com/v1/num/radix
- Auth: none declared
Query parameters
Integer to convert; optional sign and 0x/0b/0o prefix. Accepted: at most 1024 characters.
Source base 2-36, or auto (default) to read a 0x/0b/0o prefix. Accepted: integer 2-36, or 'auto'.
Target base 2-36, default 10. Accepted: integer 2-36.
Digit case for bases above 10: lower (default) or upper. Accepted: lower, upper.
Emit 0x/0b/0o where conventional. Default false. Accepted: true or false.
Response
Paid and settled. data is route-specific; a route that judges its input returns 200 with data.valid: false for a bad value.
Changes
No recorded changes to this operation across all 1 revision of this API.