summaryrefslogtreecommitdiff
path: root/lib/trocla/formats/pgsql.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/trocla/formats/pgsql.rb')
-rw-r--r--lib/trocla/formats/pgsql.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/trocla/formats/pgsql.rb b/lib/trocla/formats/pgsql.rb
new file mode 100644
index 0000000..ef4fed3
--- /dev/null
+++ b/lib/trocla/formats/pgsql.rb
@@ -0,0 +1,7 @@
+class Trocla::Formats::Pgsql < Trocla::Formats::Base
+ require 'digest/md5'
+ def format(plain_password,options={})
+ raise "You need pass the username as an option to use this format" unless options['username']
+ "md5" + Digest::MD5.hexdigest(plain_password + options['username'])
+ end
+end