Equivalent of PHP "hex2bin()" - Mailing list pgsql-general

From Stephen Cook
Subject Equivalent of PHP "hex2bin()"
Date
Msg-id 54948CAB.5080307@gmail.com
Whole thread Raw
Responses Re: Equivalent of PHP "hex2bin()"
List pgsql-general
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 string". Basically you can take binary data and each byte becomes two hexadecimal characters.

Is there anything in PostgreSQL that can do this already? I'm sure I can work it out but it can't hurt to ask first.

-- Stephen

pgsql-general by date:

Previous
From: Arup Rakshit
Date:
Subject: Re: Uninstall Postgresql in openSUSE 13.1
Next
From: John McKown
Date:
Subject: Re: Equivalent of PHP "hex2bin()"