Equivalent of PHP "hex2bin()"

From: Stephen Cook <sclists(at)gmail(dot)com>
To: PostgreSQL - general <pgsql-general(at)postgresql(dot)org>
Subject: Equivalent of PHP "hex2bin()"
Date: 2014-12-19 20:38:03
Message-ID: 54948CAB.5080307@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John McKown 2014-12-19 20:47:59 Re: Equivalent of PHP "hex2bin()"
Previous Message Arup Rakshit 2014-12-19 19:50:38 Re: Uninstall Postgresql in openSUSE 13.1