Re: How to emulate password generation in PHP with PlpgSQL?

From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: Andre Lopes <lopes80andre(at)gmail(dot)com>
Cc: postgresql Forums <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to emulate password generation in PHP with PlpgSQL?
Date: 2010-06-15 20:15:17
Message-ID: AANLkTimoyVeLN3if3C97OGIA_bAjupd4HDI5X5ZYLGuq@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Jun 13, 2010 at 8:45 AM, Andre Lopes <lopes80andre(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Frost 2010-06-15 20:25:55 Re: GSS Authentication
Previous Message M. Bashir Al-Noimi 2010-06-15 20:04:48 Re: Problem serving one-click installer to Syria