To build a set of hexadecimal binary characters using the string method as you've done above, you shoud eval() the results of the concatenation.
eval('\\x' + '41'); Results in a hex bytecode value of 65 which is the character code for 'A'.
Note that the end result of the string concatenation of my above expression (what's inside the eval parens) is '\x41', which when evaluated using eval() will build character code 'A'.
The quick and dirty fix is to change your return .... concats containing all the double backslashes to: