Looking for unique number of Base X

there is

define an array of all the “digits” for whatever base, the use heaps algorithm
for binary the array would only hold 0 and 1
for octal 0,1,2,3,4,5,6,7
for decimal all digits 0 - 9
for hex all digits 0-9 + abcdef
etc