Jano Svitok
1/13/2007 1:51:00 PM
On 1/13/07, Felipe Cruxen <fcruxen@gmail.com> wrote:
> I'm coding a "postfixadmin" using ruby, so, all the passwords are stored
> in DB using a bsd like md5 hash. Is there any simple way I could
> generate passwords like that (the same hash could be used to generate
> shadow pass?)?.
>
> Really sorry for my lame english, and if the question is stupid, but I'm
> a real newbie to ruby.
you can generate MD5 with:
require 'digest/md5'
hash = Digest::MD5.digest(data) # binary
or hash = Digest::MD5.hexdigest(data) #hexa