Sha256: 413ff87bf0d70fae5008b62449ff1892fdf378f5a94342909265e7650003e84a

Contents?: true

Size: 1.24 KB

Versions: 22

Compression:

Stored size: 1.24 KB

Contents

# frozen_string_literal: true

require "argon2id/extension"
require "argon2id/password"
require "argon2id/version"

module Argon2id
  # The default "time cost" of 2 iterations recommended by OWASP.
  DEFAULT_T_COST = 2

  # The default "memory cost" of 19 mebibytes recommended by OWASP.
  DEFAULT_M_COST = 19_456

  # The default 1 thread and compute lane recommended by OWASP.
  DEFAULT_PARALLELISM = 1

  # The default salt length of 16 bytes.
  DEFAULT_SALT_LEN = 16

  # The default desired hash length of 32 bytes.
  DEFAULT_OUTPUT_LEN = 32

  @t_cost = DEFAULT_T_COST
  @m_cost = DEFAULT_M_COST
  @parallelism = DEFAULT_PARALLELISM
  @salt_len = DEFAULT_SALT_LEN
  @output_len = DEFAULT_OUTPUT_LEN

  class << self
    # The default number of iterations used by Argon2id::Password.create
    attr_accessor :t_cost

    # The default memory cost in kibibytes used by Argon2id::Password.create
    attr_accessor :m_cost

    # The default number of threads and compute lanes used by Argon2id::Password.create
    attr_accessor :parallelism

    # The default salt size in bytes used by Argon2id::Password.create
    attr_accessor :salt_len

    # The default desired length of the hash in bytes used by Argon2id::Password.create
    attr_accessor :output_len
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
argon2id-0.7.0 lib/argon2id.rb
argon2id-0.7.0-x86_64-linux lib/argon2id.rb
argon2id-0.7.0-x86_64-darwin lib/argon2id.rb
argon2id-0.7.0-x86-mingw32 lib/argon2id.rb
argon2id-0.7.0-x86-linux lib/argon2id.rb
argon2id-0.7.0-x64-mingw32 lib/argon2id.rb
argon2id-0.7.0-x64-mingw-ucrt lib/argon2id.rb
argon2id-0.7.0-java lib/argon2id.rb
argon2id-0.7.0-arm64-darwin lib/argon2id.rb
argon2id-0.7.0-arm-linux lib/argon2id.rb
argon2id-0.7.0-aarch64-linux lib/argon2id.rb
argon2id-0.6.0 lib/argon2id.rb
argon2id-0.6.0-x86_64-linux lib/argon2id.rb
argon2id-0.6.0-x86_64-darwin lib/argon2id.rb
argon2id-0.6.0-x86-mingw32 lib/argon2id.rb
argon2id-0.6.0-x86-linux lib/argon2id.rb
argon2id-0.6.0-x64-mingw32 lib/argon2id.rb
argon2id-0.6.0-x64-mingw-ucrt lib/argon2id.rb
argon2id-0.6.0-java lib/argon2id.rb
argon2id-0.6.0-arm64-darwin lib/argon2id.rb