So i want to XOR on hexadecimal so i do this
select X'4e20' # X'4521'; --the output is 0000101100000001
but the thing is i wanna do XOR binary with hexa or integer with hexa or integer with binary, so i try to do this
select X(select to_hex(6700::bit(16))) # X'4F21';
this query will produce error result
[Err] ERROR: syntax error at or near "select"
LINE 2: select X(select to_hex(6700::bit(16))) # ...
So how can i do this that? and is it possible to xor an Ascii on postgresql? and i want to know how to :
1.convert binary to integer
2.convert hexa to binary vice versa
3.convert hexa to integer
4.conver ascii to integer
this is Bit String Functions and Operators official from postgresql https://www.postgresql.org/docs/9.4/static/functions-bitstring.html