Connecting Tech Pros Worldwide Forums | Help | Site Map

SHA function?

Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,754
#1: Feb 25 '07
Hi.

I've been looking for a function similar to MySQL's sha() function in Postgre and I can't seem to find anything.

The reason is that I have a system that is written for MySQL and I've been asked to make it compatible with Postgre.

Thanks.

Moderator
 
Join Date: Nov 2006
Location: Boston, USA
Posts: 505
#2: Feb 26 '07

re: SHA function?


I haven't seen this in the standard Postgresql distribution, although Postgres internally uses md5 for password encoding.

Both, sha and md5 are provided with contrib/pgcrypto
(contrib is the set of optional extensions to the core Postgresql distribution.)

Many Postgres APIs (PHP, Java, etc) have their own implementation of sha and md5 and perhaps this could be another option to consider.
Reply