Method: BCrypt::Password#initialize
- Defined in:
- lib/bcrypt.rb
#initialize(raw_hash) ⇒ Password
Initializes a BCrypt::Password instance with the data from a stored hash.
166 167 168 169 170 171 172 173 |
# File 'lib/bcrypt.rb', line 166 def initialize(raw_hash) if valid_hash?(raw_hash) self.replace(raw_hash) @version, @cost, @salt, @checksum = split_hash(self) else raise Errors::InvalidHash.new("invalid hash") end end |