[GENERAL] Equivalent of PHP hex2bin()

2014-12-19 Thread Stephen Cook
PHP has functions bin2hex() and hex2bin(), and I have to deal with the results in PostgreSQL. These functions Returns an ASCII string containing the hexadecimal representation of |str|. The conversion is done byte-wise with the high-nibble first and Decodes a hexadecimally encoded binary

Re: [GENERAL] Equivalent of PHP hex2bin()

2014-12-19 Thread John McKown
to_hex() takes in integer or bigint and returns a hexadecimal string equivalent. But there is also, perhaps better, encode() and decode() which convert string to either base64, hex, or escape codes. http://www.postgresql.org/docs/9.3/static/functions-string.html On Fri, Dec 19, 2014 at 2:38 PM,