Class: HyperKittenMeow::Encryptor

Inherits:
Object
  • Object
show all
Defined in:
app/models/hyper_kitten_meow/encryptor.rb

Class Method Summary collapse

Class Method Details

.encrypt(string) ⇒ Object

Returns the hash digest of the given string.



4
5
6
7
8
# File 'app/models/hyper_kitten_meow/encryptor.rb', line 4

def self.encrypt(string)
  cost = ActiveModel::SecurePassword.min_cost ? BCrypt::Engine::MIN_COST :
                                                BCrypt::Engine.cost
  BCrypt::Password.create(string, cost: cost)
end