Re: How to emulate password generation in PHP with PlpgSQL? - Mailing list pgsql-general

From Josh Kupershmidt
Subject Re: How to emulate password generation in PHP with PlpgSQL?
Date
Msg-id AANLkTimoyVeLN3if3C97OGIA_bAjupd4HDI5X5ZYLGuq@mail.gmail.com
Whole thread Raw
In response to How to emulate password generation in PHP with PlpgSQL?  (Andre Lopes <lopes80andre@gmail.com>)
List pgsql-general
On Sun, Jun 13, 2010 at 8:45 AM, Andre Lopes <lopes80andre@gmail.com> wrote:

> But I'am not getting how to generate the SALT. Can someone give me a clue on
> how to do this.

The salt() function you posted returns 10 random hexadecimal digits.
You could mimic it with something like:
SELECT substr(md5(RANDOM()::text), 0, 11);

Josh

pgsql-general by date:

Previous
From: Alan Hodgson
Date:
Subject: Re: Backups / replication
Next
From: Stephen Frost
Date:
Subject: Re: GSS Authentication