Class: Passlib::Yescrypt
Overview
Handles yescrypt password hashing via the yescrypt gem.
Hash format: $y$jAU…/.….0$<salt>$<checksum>
Constant Summary
Constants included from Internal::DSL
Instance Attribute Summary
Attributes inherited from Password
Class Method Summary collapse
-
.create(secret, **options) ⇒ Yescrypt
Creates a new yescrypt hash.
Instance Method Summary collapse
Methods inherited from Password
available?, #create_comparable, #initialize, #inspect, load, #pretty_print
Methods included from Internal::DSL
Constructor Details
This class inherits a constructor from Passlib::Password
Class Method Details
.create(secret, **options) ⇒ Yescrypt
Creates a new yescrypt hash.
23 24 25 26 27 28 29 30 |
# File 'lib/passlib/yescrypt.rb', line 23 class Yescrypt < Password register mcf: "y" external "yescrypt", ">= 0.1.1" :n_log2, :r, :p, :t, :flags, :salt def verify(secret) = ::Yescrypt.verify(secret, string) def create(secret) = ::Yescrypt.create(secret, **config) def upgrade? = !::Yescrypt.cost_matches?(string, **config) end |
Instance Method Details
#create(secret) ⇒ Object
28 |
# File 'lib/passlib/yescrypt.rb', line 28 def create(secret) = ::Yescrypt.create(secret, **config) |
#upgrade? ⇒ Boolean
29 |
# File 'lib/passlib/yescrypt.rb', line 29 def upgrade? = !::Yescrypt.cost_matches?(string, **config) |
#verify(secret) ⇒ Object
27 |
# File 'lib/passlib/yescrypt.rb', line 27 def verify(secret) = ::Yescrypt.verify(secret, string) |