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
Constants
DEFAULT: Crypto::Argon2::Params
OWASP's first recommended setting: m=19456 (19 MiB), t=2, p=1.
Class methods
def self.new(memory_kib: Int, iterations: Int, parallelism: Int) -> Crypto::Argon2::Params
Raises ArgumentError for a parameter outside its bounds.
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).
Methods
def memory_kib -> Int
The memory in KiB: 8 to 4_194_304 (4 GiB), and at least
8 * parallelism.
def iterations -> Int
The passes: 1 to 2^32 - 1.
def parallelism -> Int
The lanes: 1 to 255. (They are computed one after the other: the hash runs on one thread.)
def to_h -> Hash[Symbol, Object]
The fields as a Hash, by name.
def with(*, memory_kib: Int = …, iterations: Int = …, parallelism: Int = …) -> Crypto::Argon2::Params
A copy with the fields given replaced.
def inspect -> String
#<Crypto::Argon2::Params m=19456 t=2 p=1>.
def to_s -> String
#<Crypto::Argon2::Params m=19456 t=2 p=1>.