Convert a binary number (of any size) into a hexadecimal number.
Input
A POSITIVE binary number with just the 0
s and 1
s. A valid input will always match the following regex: [0-1]+
. If the input is not a valid binary number, that is, anything not matching this regex, the output should be 0
or the program should exit, or error. The output does not need the leading 0x
nor does it need to be capitalized.
Output
The binary number converted to hexadecimal.
Winning
Original Code-Golf Rules, Lowest amount of bytes.
Examples
IN: [101]
OUT: [0x5] OR [5]
IN: [10000000010100100000]
OUT: [0x80520] OR [80520]
IN: [1010101]
OUT: [0x55] OR [55]
IN: [1111111111111111]
OUT: [0xFFFF] OR [FFFF] OR [0xffff] OR [ffff]
IN: [1012101]
OUT: [0]
IN: [a]
OUT: [0]
IN: [-1010101]
OUT: [0]
IN: [abcdef]
OUT: [0]
IN: [2]
OUT: [0]
[01]+
\$\endgroup\$