class Veil::Hasher

Constants

DEFAULT_OPTIONS

Public Class Methods

create(opts = {}) click to toggle source

Create a new Hasher instance

@param opts Hash<Symbol> a hash of options to pass to the constructor

@example Veil::Hasher.create(type: “BCrypt”, cost: 10) @example Veil::Hasher.create(type: “PBKDF2”, iterations: 1000, hash_function: “SHA256”)

# File lib/veil/hasher.rb, line 23
def create(opts = {})
  opts = Veil::Utils.symbolize_keys(DEFAULT_OPTIONS.merge(opts))
  const_get(opts[:type]).new(opts)
end