Class: Trocla::Formats::Bcrypt

Inherits:
Base
  • Object
show all
Defined in:
lib/trocla/formats/bcrypt.rb

Instance Attribute Summary

Attributes inherited from Base

#trocla

Instance Method Summary collapse

Methods inherited from Base

expensive, #expensive?, expensive?, #initialize, #render

Constructor Details

This class inherits a constructor from Trocla::Formats::Base

Instance Method Details

#format(plain_password, options = {}) ⇒ Object



4
5
6
# File 'lib/trocla/formats/bcrypt.rb', line 4

def format(plain_password, options = {})
  BCrypt::Password.create(plain_password, :cost => options['cost'] || BCrypt::Engine.cost).to_s
end