Base 36 To Gray Code
How This Converter Works
Encodes a non-negative base-36 integer using digits 0-9 and case-insensitive letters A-Z as reflected binary Gray code; spaces, underscores, and an optional leading plus sign are accepted, while negative values are rejected.
Formula or rule
Remove whitespace and underscores, validate base-36 digits, convert the value n to binary, then compute Gray = n XOR (n >> 1).
Example
- Input
- 19
- Calculation
- 19₃₆ = 45₁₀ = 101101₂; 101101 XOR 010110 = 111011.
- Result
- 111011
Notes
Gray code represents non-negative integers; negative inputs are rejected.