data Crypto::Argon2::Params(memory_kib: Int, iterations: Int, parallelism: Int)

The cost of a hash: memory_kib KiB of memory, iterations passes over it, parallelism lanes. A data value: immutable and Shareable.

p = Crypto::Argon2::Params.new(memory_kib: 47_104, iterations: 1, parallelism: 1)
p.inspect                                             # => "#<Crypto::Argon2::Params m=47104 t=1 p=1>"
Crypto::Argon2::Params::DEFAULT.memory_kib            # => 19456

<std:crypto>:178

Constants

DEFAULT: Crypto::Argon2::Params

OWASP's first recommended setting: m=19456 (19 MiB), t=2, p=1.

<std:crypto>:208

Class methods

def self.new(memory_kib: Int, iterations: Int, parallelism: Int) -> Crypto::Argon2::Params

Raises ArgumentError for a parameter outside its bounds.

<std:crypto>:189

def self.of(hash: String) -> Crypto::Argon2::Params

The parameters of the argon2id PHC string hash; Crypto::Error when it is not one (another scheme, another version, a string that does not parse).

<std:crypto>:213

Methods

def memory_kib -> Int

The memory in KiB: 8 to 4_194_304 (4 GiB), and at least 8 * parallelism.

<std:crypto>:181

def iterations -> Int

The passes: 1 to 2^32 - 1.

<std:crypto>:183

def parallelism -> Int

The lanes: 1 to 255. (They are computed one after the other: the hash runs on one thread.)

<std:crypto>:186

def to_h -> Hash[Symbol, Object]

The fields as a Hash, by name.

<std:crypto>:189

def with(*, memory_kib: Int = …, iterations: Int = …, parallelism: Int = …) -> Crypto::Argon2::Params

A copy with the fields given replaced.

<std:crypto>:189

def inspect -> String

#<Crypto::Argon2::Params m=19456 t=2 p=1>.

<std:crypto>:220

def to_s -> String

#<Crypto::Argon2::Params m=19456 t=2 p=1>.

<std:crypto>:223