diff options
author | mh <mh@immerda.ch> | 2014-06-27 19:23:20 +0200 |
---|---|---|
committer | mh <mh@immerda.ch> | 2014-06-27 19:23:20 +0200 |
commit | ecb2a2c7c6ec3576bc49747a484fa0f8e93a50fa (patch) | |
tree | 05ccf120e136b3d6d77a8d91f9930f0139b8e54b /lib/trocla/formats/sha1.rb | |
parent | 20de208ee827cb451e60705180909ce81eae0127 (diff) | |
parent | 08ac533d2156b666ae6ca68e797992629051315f (diff) |
Merge branch 'tilya-charset_option'
Diffstat (limited to 'lib/trocla/formats/sha1.rb')
-rw-r--r-- | lib/trocla/formats/sha1.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/trocla/formats/sha1.rb b/lib/trocla/formats/sha1.rb new file mode 100644 index 0000000..1321b35 --- /dev/null +++ b/lib/trocla/formats/sha1.rb @@ -0,0 +1,7 @@ +class Trocla::Formats::Sha1 < Trocla::Formats::Base + require 'digest/sha1' + require 'base64' + def format(plain_password,options={}) + '{SHA}' + Base64.encode64(Digest::SHA1.digest(plain_password)) + end +end |